How to Plot Histogram in Matplotlib

Machine Learning courses with 100+ Real-time projects Start Now!!

Program 1

import matplotlib.pyplot as mat
prod_price=[0,10,25,30,70,100,150,400,350,500,700]
prod_range=[0,30,100,150,300,500,800]
mat.hist(prod_price,prod_range,rwidth=0.3,histtype="bar",facecolor='r')
mat.xticks([0,30,50,100,300,500,800])
mat.title("Product Price Range")
mat.xlabel("Product Price")
mat.ylabel("Product Range")
mat.show()

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *