Page 207 - Robotics and AI class 10
P. 207
plt.xlabel('Metro Cities')
plt.ylabel('Temp in Celsius')
plt.title('Temperature Study of the Day')
# Displaying the chart
plt.show()
Temperature Study of the Day
40
35
30
Temp in Celsius 20
25
15
10
5
0
Delhi Mumbai Chennai Kolkata
Metro Cities
Another example is:
Example:
import matplotlib.pyplot as plt
marks = [23, 45, 34, 41,13,49]
plt.bar(["Eng","Maths","Science","SSt","2nd Lang","Computers"], marks)
plt.title('Bar Chart')
plt.xlabel('Subjects')
plt.ylabel('Marks')
plt.show()
Output:
Bar Chart
50
40
30
Marks 20
10
5
0
Eng Maths Science Sst 2nd Lang Computers
Subjects
Introduction to Data and Programming with Python 205

