การพล็อตทางสถิติ

การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

Ariel Rokem

Data Scientist

การเพิ่ม error bar ในแผนภูมิแท่ง

fig, ax = plt.subplots()

ax.bar("Rowing",
       mens_rowing["Height"].mean(),
       yerr=mens_rowing["Height"].std())

ax.bar("Gymnastics",
       mens_gymnastics["Height"].mean(),
       yerr=mens_gymnastics["Height"].std())

ax.set_ylabel("Height (cm)")

plt.show()
การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

Error bar ในแผนภูมิแท่ง

การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

การเพิ่ม error bar ในกราฟเส้น

fig, ax = plt.subplots()

ax.errorbar(seattle_weather["MONTH"],
            seattle_weather["MLY-TAVG-NORMAL"],
            yerr=seattle_weather["MLY-TAVG-STDDEV"])

ax.errorbar(austin_weather["MONTH"],
            austin_weather["MLY-TAVG-NORMAL"],
            yerr=austin_weather["MLY-TAVG-STDDEV"])

ax.set_ylabel("Temperature (Fahrenheit)")

plt.show()
การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

Error bar ในกราฟเส้น

การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

การเพิ่ม boxplot

fig, ax = plt.subplots()

ax.boxplot([mens_rowing["Height"], mens_gymnastics["Height"]])
ax.set_xticklabels(["Rowing", "Gymnastics"]) ax.set_ylabel("Height (cm)") plt.show()
การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

การอ่านค่า boxplot

การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

มาฝึกกันเถอะ!

การสร้างภาพข้อมูลด้วย Matplotlib เบื้องต้น

Preparing Video For Download...