+3 votes
in Class 12 by kratos

A bar chart is drawn(using pyplot) to represent sales data of various models of cars, for a month. Write appropriate statements in Python to provide labels Month - June and Sale done to x and y axis respectively.

1 Answer

+6 votes
by kratos
 
Best answer

import matplotlib.pyplot as plt

import numpy as np

model=(‘i20’,’Grandi10’,’Creta’,’Eon’,’Verna’,’Tucson’,’Elantra’)

y_pos=np.arange(len(model))

sale=[12369,12174,9390,4663,4077,3712,200,150]

plt.bar(y_pos,sale,align=’center’,alpha=0.5)

plt.xticks(y_pos,model)

plt.xlabel(‘Month-June’)

plt.ylabel(‘Sale done’)

plt.title(‘Sales Bar Graph’)

plt.show()

...