
Hệ thống quản trị đào tạo trực tuyến
CÁC BIỂU ĐỒ CƠ BẢN
Dùng để thể hiện xu hướng theo thời gian.
import matplotlib.pyplot as plt
months = ["Jan","Feb","Mar","Apr"]
revenue = [1000,1500,1800,2000]
plt.plot(months,revenue)
plt.title("Revenue by Month")
plt.xlabel("Month")
plt.ylabel("Revenue")
plt.show()
Dùng để so sánh giữa các nhóm dữ liệu.
products = ["A","B","C"]
sales = [300,500,200]
plt.bar(products,sales)
plt.title("Sales by Product")
plt.show()
Dùng để thể hiện tỷ lệ phần trăm.
regions = ["North","South","East","West"]
sales = [40,25,20,15]
plt.pie(sales,labels=regions,autopct="%1.1f%%")
plt.title("Sales by Region")
plt.show()
Dùng để xem phân bố dữ liệu.
import numpy as np
data = np.random.normal(50,10,100)
plt.hist(data,bins=10)
plt.show()ư