Python สำหรับผู้ใช้ R
Daniel Chen
Instructor
plot()kind ให้กับ plotkind):line : กราฟเส้น (ค่าเริ่มต้น)bar : กราฟแท่งแนวตั้งbarh : กราฟแท่งแนวนอนhist : ฮิสโตแกรมbox : boxplotkde : กราฟ Kernel Density Estimationdensity : เหมือนกับ 'kde'area : กราฟพื้นที่pie : กราฟวงกลมscatter : กราฟกระจายhexbin : hexbin plotimport 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()

Python สำหรับผู้ใช้ R