Python seaborn将替换matplotlib

Python seaborn将替换matplotlib,python,matplotlib,seaborn,Python,Matplotlib,Seaborn,我试图用seaborn绘制一个简单的绘图,我用patplotlib import matplotlib.pyplot as plt radius = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] area = [3.14159, 12.56636, 28.27431, 50.26544, 78.53975, 113.09724] square = [1.0, 4.0, 9.0, 16.0, 25.0, 36.0] plt.plot(radius,

我试图用
seaborn
绘制一个简单的绘图,我用
patplotlib

 import matplotlib.pyplot as plt
    radius = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
    area = [3.14159, 12.56636, 28.27431, 50.26544, 78.53975, 113.09724]
    square = [1.0, 4.0, 9.0, 16.0, 25.0, 36.0]
    plt.plot(radius, area, label='Circle')
    plt.plot(radius, square, marker='o', linestyle='--', color='r', label='Square')
    plt.xlabel('Radius/Side')
    plt.ylabel('Area')
    plt.title('Area of Shapes')
    plt.legend()
    plt.show()

有什么想法吗?

像这样使用,与默认matplotlib绘图相比,您的绘图看起来会更好:

import seaborn as sb
import matplotlib.pyplot as plt

sb.set_style("darkgrid")
radius = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
area = [3.14159, 12.56636, 28.27431, 50.26544, 78.53975, 113.09724]
square = [1.0, 4.0, 9.0, 16.0, 25.0, 36.0]
plt.plot(radius, area, label='Circle')
plt.plot(radius, square, marker='o', linestyle='--', color='r', label='Square')
plt.xlabel('Radius/Side')
plt.ylabel('Area')
plt.title('Area of Shapes')
plt.legend()
plt.show()

希望这对你有用。不过请检查一下缩进。可以找到seaborn的良好资源

,包括识别错误?