question about legend

Hi all

i am making a scatter plot and want to label one of the points in the legend. i run

scatter([x], [y], …, label=“mylabel”)

and then run legend as follows

plt.legend(loc=‘lower right’, numpoints=1, pad=0.01, labelsep=.01, handlelen=.05)

i set numpoints=1 because i want it to show just one point and then its label. however, this always generates a legend with three points, i.e.

o o o my label

rather than

o mylabel

does anyone know how to fix this? thank you.

The documentation for scatter command is out of date unfortunately.
You need to use "scatterpoints" keyword.

http://www.nabble.com/legend-bug--td22466216.html#a22466216

-JJ

···

On Mon, Jul 27, 2009 at 3:44 PM, per freem<perfreem@...287...> wrote:

Hi all

i am making a scatter plot and want to label one of the points in the
legend. i run

scatter(, [y], ..., label="mylabel")

and then run legend as follows

plt.legend(loc='lower right', numpoints=1, pad=0.01, labelsep=.01,
handlelen=.05)

i set numpoints=1 because i want it to show just one point and then its
label. however, this always generates a legend with three points, i.e.

o o o my label

rather than

o mylabel

does anyone know how to fix this? thank you.

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options