Scatter Plot

Scatter Plot :

import matplotlib.pyplot as plt
a= [1,3,5,76,7,18,77,80,46,50,78,99]
b= [12,15,19,59,58,66,69,70,87,92,35,38]
x= [11,22,33,44,55,66,77,88,23,45,65,76]
plt.scatter(a,b)
plt.scatter(a,x)
plt.scatter(b,x)
plt. show()
customizing Scatter Plot :

import matplotlib.pyplot as plt
a= [1,3,5,76,7,18,77,80,46,50,78,99]
b= [12,15,19,59,58,66,69,70,87,92,35,38]
x= [11,22,33,44,55,66,77,88,23,45,65,76]

fig = plt.figure(figsize=(10,5))

plt.scatter(a,b,color = "red",s = 100, edgecolor = "black",alpha= 1.0, marker= "p")

plt.scatter(a,x,color = "green",edgecolor = "maroon",s = 100,alpha = 1.0,marker = "o")

plt.scatter(b,x,color = "blue",edgecolor = "black" ,s = 50,alpha = 1.0,marker = "8")

plt. grid(True)
plt.legend()
plt.xlabel("X axis")
plt.ylabel("Y axis")
plt. show()
Adding Three Scatter Plot :

import matplotlib.pyplot as plt
a= [1,3,5,76,7,18,77,80,46,50,78,99]
b= [12,15,19,59,58,66,69,70,87,92,35,38]
x= [11,22,33,44,55,66,77,88,23,45,65,76]

fig = plt.figure(figsize=(10,5))

a1= [1,3,5,76,7,18,77,80,46,50,78,99]
b1= [12,15,19,59,58,66,69,70,87,92,35,38]
x1= [11,22,33,44,55,66,77,88,23,45,65,76]

X = plt. subplot(2,2,1)

plt.scatter(a,b,color = "red",s = 100,edgecolor = "black",alpha= 1.0,marker= "p")

plt.scatter(a,x,color = "green",edgecolor = "maroon",s = 100,alpha = 1.0,marker = "o")

plt.scatter(b,x,color = "blue",edgecolor = "black" ,s = 50,alpha = 1.0,marker = "8")

Y= plt.subplot(2,2,2)
plt.scatter(a1,b1)
plt. scatter(a1,x1)
plt. scatter(b1,x1)

a2= [1,3,5,76,7,18,77,80,46,50,78,99]
b2= [12,15,19,59,58,66,69,70,87,92,35,38]
x2= [11,22,33,44,55,66,77,88,23,45,65,76]

Y1= plt.subplot(2,2,3)
plt.scatter(a2,b2)
plt. scatter(a2,x2)
plt. scatter(b2,x2)

plt. grid(True)
plt.legend()
plt.xlabel("X axis")
plt.ylabel("Y axis")
plt. show()

Comments

Popular posts from this blog

Python Tokens

Pie Chart , Donut Plot, Area plot