Python Matplotlib Charts
Python Matplotlib Charts
Items:
- Ordinary bread: 320
- Fruit Bread: 80
- Cakes and pastries: 160
- Biscuits: 120
- Others: 40
Code:
items = ['Ordinary bread', 'Fruit Bread', 'Cakes and pastries', 'Biscuits', 'Others']
sales = [320, 80, 160, 120, 40]
plt.figure(figsize=(6, 6))
plt.pie(sales, labels=items, autopct='%1.1f%%', startangle=140)
plt.title("Sales in Baker's Shop")
plt.show()
Code:
Code:
categories = ['Beast Animals', 'Other Land animals', 'Birds', 'Water Animals', 'Reptiles']
creatures = [150, 400, 225, 175, 50]
plt.figure(figsize=(6, 6))
plt.pie(creatures, labels=categories, autopct='%1.1f%%', startangle=140)
plt.title("Creatures in a Zoological Park")
plt.show()
Modes of Transport:
- School Bus: 350
- Private Bus: 245
- Bicycle: 210
- Rickshaw: 175
- On foot: 280
Code:
import matplotlib.pyplot as plt
Code:
Code:
import matplotlib.pyplot as plt