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. Can a new kwarg be introduced to pyplot.text() to provide the same functionality?
ax.text(0.05, 0.95, ‘Entries: ‘ + len(myData),
transform=ax.transAxes, fontsize=14, verticalalignment=’top’,
bbox=dict(boxstyle=’square’, facecolor=’white’))
It might be better to build this into
annotation
instead oftext
becausetext
takes anx
and ay
where asannotation
already takes anxy
argument. Instead of having to add an extra kwarg (which conflicts positional arguments),xy
can just be allowed to take a string (which is relatively easy to switch onif is_stringlike(xy) and xy == 'best':
).Is this still part of a milestone? Would certainly be a very useful feature!