

importmatplotlib.pyplotaspltfromnumpy.randomimportrandfig,ax=plt.subplots()forcolorin['red','green','blue']:n=750x,y=rand(2,n)scale=200.0*rand(n)ax.scatter(x,y,c=color,s=scale,label=color,alpha=0.3,edgecolors='none')ax.legend()ax.grid(True)plt.show()
Keywords: python, matplotlib, pylab, example, codex (seeSearch examples)