A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Get total profit of all months and show line plot with the following Style properties
Q:

Get total profit of all months and show line plot with the following Style properties

0

Get total profit of all months and show line plot with the following Style properties

Generated line plot must include following Style properties: –

  • Line Style dotted and Line-color should be red
  • Show legend at the lower right location.
  • X label name = Month Number
  • Y label name = Sold units number
  • Add a circle marker.
  • Line marker color as read
  • Line width should be 3

The line plot graph should look like this.

Matplotlib Exercise 2: Get Total profit of all months and show line plot with the following Style properties

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")
profitList = df ['total_profit'].tolist()
monthList  = df ['month_number'].tolist()

plt.plot(monthList, profitList, label = 'Profit data of last year', 
      color='r', marker='o', markerfacecolor='k', 
      linestyle='--', linewidth=3)
      
plt.xlabel('Month Number')
plt.ylabel('Profit in dollar')
plt.legend(loc='lower right')
plt.title('Company Sales data of last year')
plt.xticks(monthList)
plt.yticks([100000, 200000, 300000, 400000, 500000])
plt.show()

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

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now