Pie Chart

PHOTO EMBED

Tue Nov 19 2024 02:49:48 GMT+0000 (Coordinated Universal Time)

Saved by @login123

#4. Pie Chart
#Pie charts are used to show proportions of a whole.
# Example: Pie chart of Profit distribution by Region
profit_by_region = [7000, 11000, 7000, 8000]
regions = ["North", "East", "West", "South"]

plt.pie(profit_by_region, labels=regions, autopct='%1.1f%%', colors=['gold', 'lightblue', 'lightgreen', 'pink'])
plt.title("Profit Distribution by Region")
plt.show()

content_copyCOPY