การใส่คำอธิบายในข้อมูลอนุกรมเวลา

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

Ariel Rokem

Data Scientist

ข้อมูลอนุกรมเวลา

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

การใส่คำอธิบาย

fig, ax = plt.subplots()
plot_timeseries(ax, climate_change.index, climate_change['co2'],
               'blue', 'Time', 'CO2 (ppm)')
ax2 = ax.twinx()
plot_timeseries(ax2, climate_change.index, 
                climate_change['relative_temp'],
               'red', 'Time', 'Relative temperature (Celsius)')

ax2.annotate(">1 degree", xy=(pd.Timestamp("2015-10-06"), 1))
plt.show()

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

การกำหนดตำแหน่งข้อความ

ax2.annotate(">1 degree",
             xy=(pd.Timestamp('2015-10-06'), 1),
             xytext=(pd.Timestamp('2008-10-06'), -0.2))

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

การเพิ่มลูกศรในคำอธิบาย

ax2.annotate(">1 degree",
             xy=(pd.Timestamp('2015-10-06'), 1),
             xytext=(pd.Timestamp('2008-10-06'), -0.2),
             arrowprops={})

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

การปรับแต่งคุณสมบัติลูกศร

ax2.annotate(">1 degree",
             xy=(pd.Timestamp('2015-10-06'), 1),
             xytext=(pd.Timestamp('2008-10-06'), -0.2),
             arrowprops={"arrowstyle":"->", "color":"gray"})

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

การปรับแต่งคำอธิบาย

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

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

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

Preparing Video For Download...