>>>>> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes:

    Eric> I think that what you want to do requires something like the
    Eric> mechanism in QuiverKey: a derived artist with a draw method
    Eric> that figures out at draw time where to put the text; I don't
    Eric> think there is any other way to handle zooming while keeping
    Eric> the screen separation from a data point fixed.

You can do this using offsets -- see
matplotlib.axis.XTick._get_text1.  This is how tick labeling is done
(a point offset from an x location in data coords and a y location in
axis coords).  Here is an example -- you have to copy the default data
transform so that the offset doesn't affect the figure data

from matplotlib.transforms import Value, 
translation_transform,blend_xy_sep_transform
from pylab import figure, show

fig = figure()
ax = fig.add_subplot(111)
points = 7
pad = fig.dpi*Value(points/72.0)
# poor man's copy
trans = blend_xy_sep_transform(ax.transData, ax.transData)

# to the left and above
offset = translation_transform(Value(-1)*pad, pad)
trans.set_offset( (0,0), offset)

ax.plot([1,2,3])

t = ax.text(1,2, 'hi', transform=trans)

show()




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to