In message <[EMAIL PROTECTED]>, Norbert Nemec
<[EMAIL PROTECTED]> wrote
>This is the result of a change that I committed in between 0.90.0 and
>0.90.1 - sorry if it caused confusion...
>
>The idea is exactly what you observed: legend() only displays those
>lines that have an explicit label set.
>
>If a certain line in a figure does not have a label, I think it is
>rather pointless displaying it in a legend at all. I mean - the legend
>is meant to explain the individual lines and the default labels like
>"line0" can hardly be counted as "explanation".

This philosophy makes perfect sense, but it broke down for me in two
ways:

1)  I am plotting 6 lines that are already associated with numbers 0
through 5, so the default labels happened to make perfect sense.

2)  In this case, I use the legend not to "explain the individual lines"
but to document the line color sequence.

Obviously, this was trivial to fix now that I understand the new
behavior.

I have to say that the present behavior with no args is pretty strange:
planting a blank box on top of the middle of the plot seems worse than
useless.  I personally would have preferred that it throw an exception.

>Maybe, though, there should be one additional condition:
>* If no lines or patchsets have explicit labels, display all defaults.
>* If any line or patch has an explicit label, display only the explicit
>labels.

I like this.  It would avoid puzzling people who try calling legend with
no args, which would likely include people experimenting interactively
in IPython.
-- 
                        Jonathan Griffitts
AnyWare Engineering                             Boulder, CO, USA

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to