Trouble with scatter and legend

Hi all,

I am wondering if I can use scatter in connection with legend
(attached test for details). I am using the latest svn version.

Any pointer would be appreciated.

Cheers,
            Nils

curve_fit.py (978 Bytes)

Your example works for me -- we recently added support for
autolegending of scatters using a proxy rectangle of the same color as
the first symbol in the scatter. This could be improved upon by using
a proxy patch with the same shape as your first polygon in the
collection, but there are some scaling issues that have to be worked
out.

Is it the fact that you get a Rectangle vs a Circle that you are
posting about? Or are you not getting anything at all for your
scatter in the legend?

JDH

···

On Thu, Aug 28, 2008 at 12:14 PM, Nils Wagner <nwagner@...1052...> wrote:

Hi all,

I am wondering if I can use scatter in connection with legend
(attached test for details). I am using the latest svn version.

Please find attached the output (test.png).
The order of the legend entries is wrong. Am I missing
something ?

Nils

test.png

···

On Thu, 28 Aug 2008 13:29:07 -0500 "John Hunter" <jdh2358@...287...> wrote:

On Thu, Aug 28, 2008 at 12:14 PM, Nils Wagner > <nwagner@...1052...> wrote:

Hi all,

I am wondering if I can use scatter in connection with legend
(attached test for details). I am using the latest svn version.

Your example works for me -- we recently added support for
autolegending of scatters using a proxy rectangle of the same color as
the first symbol in the scatter. This could be improved upon by using
a proxy patch with the same shape as your first polygon in the
collection, but there are some scaling issues that have to be worked
out.

Is it the fact that you get a Rectangle vs a Circle that you are
posting about? Or are you not getting anything at all for your
scatter in the legend?

JDH

OK, now I see your point. auto-legending doesn't respect the order of
the plots across different artist types. I hadn't thought of this
before. As a workaround, you can use the label kwarg:

  scatter(x,y,label='Messdaten')
  plot(xr,yr,label='Ausgleichskurve')
  legend(shadow=True)

JDH

···

On Thu, Aug 28, 2008 at 1:34 PM, Nils Wagner <nwagner@...1052...> wrote:

Please find attached the output (test.png).
The order of the legend entries is wrong. Am I missing
something ?