Python Matplotlib Program for Scatter Plot

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

Program 1

import matplotlib.pyplot as mat
x=[0,1,2,3,4,5]
y=[i*2 for i in x]
y1=[i**2 for i in x]
y2=[i**3 for i in x]
mat.scatter(x,y,marker='s',label="Sales",s=20,linewidth=4,color='red',alpha=1)
mat.scatter(x,y1,marker='o',label="Product",s=20,linewidth=4,color='blue',alpha=1)
mat.scatter(x,y2,marker='o',label="Company",s=20,linewidth=4,color='yellow',alpha=1)
mat.legend()
mat.show()

 

We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

courses
Image

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.

2 Responses

  1. Image Mariya Thakur says:

    Dataflair is a boon to CSE students…..

  2. Image Mariya Thakur says:

    I recommend Dataflair to every CSE students…..

Leave a Reply

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