พล็อตอนุกรมเวลาหลายชุด

การแสดงภาพข้อมูล Time Series ด้วย Python

Thomas Vincent

Head of Data Science, Getty Images

ความชัดเจนคือสิ่งสำคัญ

ในกราฟนี้ ชุดสีเริ่มต้นของ matplotlib กำหนดสีเดียวกันให้กับอนุกรมเวลา beef และ turkey

วงจรสีใน matplotlib

การแสดงภาพข้อมูล Time Series ด้วย Python

อาร์กิวเมนต์ colormap

ax = df.plot(colormap='Dark2', figsize=(14, 7))
ax.set_xlabel('Date')
ax.set_ylabel('Production Volume (in tons)')

plt.show()

ดู colormap ที่มีทั้งหมดได้ ที่นี่

การแสดงภาพข้อมูล Time Series ด้วย Python

เปลี่ยนสีเส้นด้วยอาร์กิวเมนต์ colormap

การเปลี่ยนชุดสีสำหรับการแสดงผลอนุกรมเวลา

การแสดงภาพข้อมูล Time Series ด้วย Python

เพิ่มข้อมูลเสริมให้กราฟ

ax = df.plot(colormap='Dark2', figsize=(14, 7))

df_summary = df.describe() # Specify values of cells in the table ax.table(cellText=df_summary.values, # Specify width of the table colWidths=[0.3]*len(df.columns), # Specify row labels rowLabels=df_summary.index, # Specify column labels colLabels=df_summary.columns, # Specify location of the table loc='top') plt.show()
การแสดงภาพข้อมูล Time Series ด้วย Python

เพิ่มสรุปสถิติลงในกราฟ

การเพิ่มสรุปสถิติลงในกราฟ

การแสดงภาพข้อมูล Time Series ด้วย Python

รับมือกับสเกลที่แตกต่างกัน

อนุกรมเวลาของ beef และ veal

การแสดงภาพข้อมูล Time Series ด้วย Python

เฉพาะ veal

อนุกรมเวลาของ veal เพียงอย่างเดียว

การแสดงภาพข้อมูล Time Series ด้วย Python

Facet plots

df.plot(subplots=True,
                linewidth=0.5,
                layout=(2, 4),
                figsize=(16, 10),
                sharex=False,
                sharey=False)

plt.show()
การแสดงภาพข้อมูล Time Series ด้วย Python

Facet plots

การแสดงภาพข้อมูล Time Series ด้วย Python

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

การแสดงภาพข้อมูล Time Series ด้วย Python

Preparing Video For Download...