[IPython-User] Subplot legend not working on embedded plots?

Adam Hughes hughesadam87@gmail....
Wed Jul 25 13:29:07 CDT 2012


Thanks.

That does work correctly for me; however, is printing the string "mydata"
for the name of each line.  Do you know offhand how to get it to understand
a list of strings?  I'll look through the matplotlib docs further.

On Wed, Jul 25, 2012 at 2:19 PM, Matthias BUSSONNIER <
bussonniermatthias@gmail.com> wrote:

>
> Le 25 juil. 2012 à 20:14, Adam Hughes a écrit :
>
> > Hi,
> >
> > I'm using notebook with inline plots:
> >
> > ipython notebook --pylab inline
> >
> > And noticed that if I create a subplot, then try to add a legend using
> ax.legend(), the legend doesn't appear.
> >
> > something like:
> >
> > fig, ax=plt.subplots(1, figsize=(12,12) )
> > ax.plot(x,y)
> > ax.legend()
>
> By setting a label in plot(), this works for me :
>
> fig, ax=plt.subplots(1, figsize=(5,5) )
> x,y = range(10),range(10)
> ax.plot(x,y,label='mydata')
> ax.legend()
>
> --
> Matthias
>
> >
> >
> > Am I doing something incorrectly or is this a known bug?
> > _______________________________________________
> > IPython-User mailing list
> > IPython-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-user
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120725/39567c83/attachment.html 


More information about the IPython-User mailing list