Python 3 Matplotlib Library Script to Plot a Histogram Graph From Points DataFrame Full Project For Beginners

Python 3 Matplotlib Library Script to Plot a Histogram Graph From Points DataFrame Full Project For Beginners

 

Welcome folks today in this blog post we will be plotting a histogram graph in python using matplotlib library. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to install the following matplotlib library using the pip command as shown below

See also  Python 3 PyQt5 TODO List CRUD App Using SQLite Database GUI Desktop App Full Project For Beginners

 

pip install matplotlib

 

After installing this library you need to make an app.py file and copy paste the following code

 

app.py

 

# importing matplotlib module 
from matplotlib import pyplot as plt 

# Y-axis values 
y = [10, 5, 8, 4, 2] 

# Function to plot histogram 
plt.hist(y) 

# Function to show the plot 
plt.show()

 

See also  Python 3 PyQt5 Autocomplete ComboBox Example Using QCombobox Widget Full Project For Beginners

 

And now if you execute the above python script by typing the below command as shown below

 

python app.py

 

Leave a Reply