groupshoogl.blogg.se

Add legend to scatter plot matplotlib
Add legend to scatter plot matplotlib












add legend to scatter plot matplotlib

Ho = plt.scatter(random(10), random(10), marker='x', color=colors) Hh = plt.scatter(random(10), random(10), marker='o', color=colors) H = plt.scatter(random(10), random(10), marker='o', color=colors) L = plt.scatter(random(10), random(10), marker='o', color=colors)Ī = plt.scatter(random(10), random(10), marker='o', color=colors) Ll = plt.scatter(random(10), random(10), marker='o', color=colors)

add legend to scatter plot matplotlib add legend to scatter plot matplotlib

Lo = plt.scatter(random(10), random(10), marker='x', color=colors)

ADD LEGEND TO SCATTER PLOT MATPLOTLIB CODE

In the code below I've used random values rather than plotting the same range over and over, making all the plots visible (i.e. In the legend call to have only one point for each legend entry. Also, if you are using scatter plots, use Module should work (at least with matplotlib 1.2.1 with Python 2.7.5), as in the example code below.














Add legend to scatter plot matplotlib