Le Jeudi 06 Avril 2006 12:21, Emmanuel Favre-Nicolin a =E9crit=A0:
> 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=3Darange(-2,2.1,0.2)
> fig =3D figure()
> ax =3D fig.add_subplot(111)
> ax.scatter(x,x*x,label=3D"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=3Darange(-2,2.1,0.2)
> fig =3D figure()
> ax =3D fig.add_subplot(111)
> ax.plot(x,x*x,label=3D"x*x")
> ax.legend()
> show()
>
> I'd like to use scatter which produce nice scattered plot and have legend.
> What could I do?
OK I can use plot with circle, it's fine. I was just wondering if scatter()=
=20
should not function like plot()?
|