面向 R 用户的 Python
Daniel Chen
Instructor
plot() 方法kind 指定图形类型kind:line:折线图(默认)bar:垂直条形图barh:水平条形图hist:直方图box:箱线图kde:核密度图density:同 kdearea:面积图pie:饼图scatter:散点图hexbin:六边形箱图import matplotlib.pyplot as plt
iris['sepal_length'].plot(kind='hist')
plt.show()

cts = iris['species'].value_counts()
cts.plot(kind='bar')
plt.show()

iris.plot(kind='scatter', x='Sepal.Length', y='Sepal.Width')
plt.show()

iris.plot(kind='box')
plt.show()

iris.boxplot(by='Species', column='Sepal.Length')
plt.show()

面向 R 用户的 Python