3(iii)
A company XYZ Ltd. records its monthly sales in lakhs as follows:
Month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
Sales = [25, 30, 28, 35, 40, 38]
Write a Python program using Matplotlib to:
- (a)Store the data.
- (b)Plot a bar chart with month on X-axis and sales on Y-axis.
- (c)Label the axes and give a title "XYZ Ltd. Half-Yearly Sales"
Show SolutionHide Solution↓
import matplotlib.pyplot as plt
month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
sales = [25, 30, 28, 35, 40, 38]
plt.bar(month, sales)
plt.xlabel("Month")
plt.ylabel("Sales (in lakhs)")
plt.title("XYZ Ltd. Half-Yearly Sales")
plt.show()
Output
