Cmap and ColorBar in Scatter Plot using Matplotlib
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=[0,1,4,9,16,25] #mycolor=['red','blue','green','black','blue','yellow'] mycolor=[10,20,30,40,50,60] mysize=[100,250,150,200,300,250] mat.scatter(x,y,c=mycolor,s=mysize,cmap="Accent") mat.colorbar() mat.show()
Did we exceed your expectations?
If Yes, share your valuable feedback on Google

