SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Ernest A. <ead...@gm...> - 2010年01月31日 16:58:43
Hi,
I would like to add some text relative to the legend,
let's say below it, and I don't know how to get the legend
coordinates so I can pass them to the text() method.
Does anyone know how to do it?
Alternatively, if there was a way to add text inside the
legend itself, it would also do the trick.
Thank you in advance.
Ernest
From: Jae-Joon L. <lee...@gm...> - 2010年02月01日 21:16:12
See if the example below works.
plot([1,2,3], label="test")
a=legend()
import matplotlib.offsetbox as offsetbox
txt=offsetbox.TextArea("Test 2")
box = a._legend_box
box.get_children().append(txt)
box.set_figure(box.figure)
For more control of legend, see the link below.
http://abitofpythonabitofastronomy.blogspot.com/2010/01/customized-legend.html
Regards,
-JJ
On Sun, Jan 31, 2010 at 11:59 AM, Ernest Adrogué <ead...@gm...> wrote:
> Hi,
>
> I would like to add some text relative to the legend,
> let's say below it, and I don't know how to get the legend
> coordinates so I can pass them to the text() method.
>
> Does anyone know how to do it?
>
> Alternatively, if there was a way to add text inside the
> legend itself, it would also do the trick.
>
> Thank you in advance.
>
> Ernest
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Ernest A. <ead...@gm...> - 2010年02月03日 16:20:10
 1/02/10 @ 16:15 (-0500), thus spake Jae-Joon Lee:
> See if the example below works.
> 
> plot([1,2,3], label="test")
> a=legend()
> 
> import matplotlib.offsetbox as offsetbox
> txt=offsetbox.TextArea("Test 2")
> box = a._legend_box
> box.get_children().append(txt)
> box.set_figure(box.figure)
> 
> For more control of legend, see the link below.
> 
> http://abitofpythonabitofastronomy.blogspot.com/2010/01/customized-legend.html
Thanks Jae-Joon. Your solution has worked like a charm.
> Regards,
> 
> -JJ
> 
> 
> On Sun, Jan 31, 2010 at 11:59 AM, Ernest Adrogué <ead...@gm...> wrote:
> > Hi,
> >
> > I would like to add some text relative to the legend,
> > let's say below it, and I don't know how to get the legend
> > coordinates so I can pass them to the text() method.
> >
> > Does anyone know how to do it?
> >
> > Alternatively, if there was a way to add text inside the
> > legend itself, it would also do the trick.
> >
> > Thank you in advance.
> >
> > Ernest
> >
> >
> > ------------------------------------------------------------------------------
> > The Planet: dedicated and managed hosting, cloud storage, colocation
> > Stay online with enterprise data centers and the best network in the business
> > Choose flexible plans and management services without long-term contracts
> > Personal 24x7 support from experience hosting pros just a phone call away.
> > http://p.sf.net/sfu/theplanet-com
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /