[Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Klonuo Umom
Please consider: plot([1, 2, 3, 4], label='line 1') twinx() plot([11, 12, 11, 14], label='line 2') legend() will draw only label for 'line 2' plot([1, 2, 3, 4], label='line 1') legend() twinx() plot([11, 12, 11, 14], label='line 2') legend() same result, as it will overwrite label 'line 1'

Re: [Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Stephen George
On 28/09/2011 4:32 PM, Klonuo Umom wrote: Please consider: plot([1, 2, 3, 4], label='line 1') twinx() plot([11, 12, 11, 14], label='line 2') legend() will draw only label for 'line 2' plot([1, 2, 3, 4], label='line 1') legend() twinx() plot([11, 12, 11, 14],

Re: [Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Benjamin Root
On Wednesday, September 28, 2011, Klonuo Umom klo...@gmail.com wrote: Please consider: plot([1, 2, 3, 4], label='line 1') twinx() plot([11, 12, 11, 14], label='line 2') legend() will draw only label for 'line 2' plot([1, 2, 3, 4], label='line 1') legend() twinx() plot([11, 12, 11,

Re: [Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Jae-Joon Lee
On Wed, Sep 28, 2011 at 3:32 PM, Klonuo Umom klo...@gmail.com wrote: How to deal with this, without manually positioning legends and if possible including all annotated plot lines in one legend? *twinx* creates a new axes. Thus there are TWO axes, and you need to do some manual adjustment. I

Re: [Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Klonuo Umom
Thanks Stephen, but I'm not sure if I follow correctly: I used `twinx()` as I wanted line 1 to be referenced on left Y-axis and line 2 on right Y-axis. In your example I can't see what's the purpose of twinx() command? - It presents left Y-axis as default 0 to 1 values not referenced to any plot.

Re: [Matplotlib-users] Using labels with twinx()

2011-09-28 Thread Klonuo Umom
Thanks JJ, `axes_grid1` seems to handle this issue On Wed, Sep 28, 2011 at 4:01 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: On Wed, Sep 28, 2011 at 3:32 PM, Klonuo Umom klo...@gmail.com wrote: How to deal with this, without manually positioning legends and if possible including all