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

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

 

Welcome folks today in this blog post we will be plotting a scatter 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 Tkinter Language Translator App Using Translate Module in 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 
  
# x-axis values 
x = [5, 2, 9, 4, 7] 
  
# Y-axis values 
y = [10, 5, 8, 4, 2] 
  
# Function to plot scatter 
plt.scatter(x, y) 
  
# function to show the plot 
plt.show()

 

See also  Python 3 Script to Mine Bitcoin CryptoCurrency on Command Line Using hashlib Library 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