給 R 使用者的 Python
Daniel Chen
Instructor
plot() 方法plot 的 kind 參數kind 類型:line:折線圖(預設)bar:直條圖barh:橫條圖hist:直方圖box:盒鬚圖kde:核心密度估計圖density:同『kde』area:面積圖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