My graphic goes from y=-1
to y=10
I want to write a small piece of text in an arbitrary position, say at x=2000
, y=5
:
ax.annotate('MgII', xy=(2000.0, 5.0), xycoords='data')
Now I want the same, but this time the piece of text must be outside the graphic, but in the exact position I mark in data coordinates:
ax.annotate('MgII', xy=(2000.0, 10.5), xycoords='data')
But it then disappears (remember my graphic goes from -1 to 10). There is plenty of space free on top of the graphic.
And, if I specify
xy=(2000.0, 9.999)
then the label appears nearly where I want it, only it is too close to the top border of the picture. I want it at y=10.5
, specifically.
clip_on
shouldn't work...the annotation code is a bit finicky (I think it got written first, then artist got re-factored, and annotation never got update)