legend with scatter

Hi,

when I use legend() with a scatter plot I obtain an empty legend. A test
script:

from pylab import figure, load, show,legend,arange
x=arange(-2,2.1,0.2)
fig = figure()
ax = fig.add_subplot(111)
ax.scatter(x,x*x,label="x*x")
ax.legend()
show()

If I replace scatter by plot, legend is OK. Follow a test script :

from pylab import figure, load, show,legend,arange
x=arange(-2,2.1,0.2)
fig = figure()
ax = fig.add_subplot(111)
ax.plot(x,x*x,label="x*x")
ax.legend()
show()

I'd like to use scatter which produce nice scattered plot and have legend.
What could I do?

Emmanuel

OK I can use plot with circle, it's fine. I was just wondering if scatter()
should not function like plot()?

···

Le Jeudi 06 Avril 2006 12:21, Emmanuel Favre-Nicolin a écrit :

Hi,

when I use legend() with a scatter plot I obtain an empty legend. A test
script:

from pylab import figure, load, show,legend,arange
x=arange(-2,2.1,0.2)
fig = figure()
ax = fig.add_subplot(111)
ax.scatter(x,x*x,label="x*x")
ax.legend()
show()

If I replace scatter by plot, legend is OK. Follow a test script :

from pylab import figure, load, show,legend,arange
x=arange(-2,2.1,0.2)
fig = figure()
ax = fig.add_subplot(111)
ax.plot(x,x*x,label="x*x")
ax.legend()
show()

I'd like to use scatter which produce nice scattered plot and have legend.
What could I do?