Q:

Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

belongs to collection: Python Matplotlib Exercises

0

Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

The bar chart should look like this.

Matplotlib Exercise 6: Read sales data of bathing soap of all months and show it using a bar chart. Save this plot to your hard disk

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import pandas as pd
import matplotlib.pyplot as plt  

df = pd.read_csv("D:\\Python\\Articles\\matplotlib\\sales_data.csv")
monthList  = df ['month_number'].tolist()
bathingsoapSalesData   = df ['bathingsoap'].tolist()
plt.bar(monthList, bathingsoapSalesData)
plt.xlabel('Month Number')
plt.ylabel('Sales units in number')
plt.title(' Sales data')
plt.xticks(monthList)
plt.grid(True, linewidth= 1, linestyle="--")
plt.title('bathingsoap sales data')
plt.savefig('D:\Python\Articles\matplotlib\sales_data_of_bathingsoap.png', dpi=150)
plt.show()

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Read the total profit of each month and show it us... >>
<< Read face cream and facewash product sales data an...