use legend's 'best' location for a text box

Hi,
I’m drawing a histogram and I would like to place a text box within the axes that shows the number of events. I like the way I can pass “loc=‘best’” to pyplot.legend() and it automatically does its best to avoid my data. Is there any way to replicate this for a simple call to pyplot.text(), like so:

ax.text(0.05, 0.95, 'Entries: ’ + len(myData),
transform=ax.transAxes, fontsize=14, verticalalignment=‘top’,
bbox=dict(boxstyle=‘square’, facecolor=‘white’))

Thanks in advance!

–craig

As far as I know, No, there is no such way inside matplotlib that does
that for you.
But, in theory, it should not be very difficult to implement.
Can you open a new issue on our github page?

Regards,

-JJ

···

On Thu, Jan 12, 2012 at 4:16 AM, Craig the Demolishor <destroooooy@...287...> wrote:

Hi,
I'm drawing a histogram and I would like to place a text box within the
axes that shows the number of events. I like the way I can pass "loc='best'"
to pyplot.legend() and it automatically does its best to avoid my data. Is
there any way to replicate this for a simple call to pyplot.text(), like so:

ax.text(0.05, 0.95, 'Entries: ' + len(myData),
transform=ax.transAxes, fontsize=14, verticalalignment='top',
bbox=dict(boxstyle='square', facecolor='white'))

Thanks in advance!

--craig

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users