John Hunter wrote:
> On Sun, Jan 3, 2010 at 10:22 AM, Ryan May <rma...@gmail.com> wrote:
>>> the marker.  It would be great if one could specify the text offsets in
>>> units of the font size rather than in units of map distance.
>> You can do it, it just takes a bit of knowledge about how different
>> transformations are used under the hood:
> 
> See also, the transforms tutorial:
> 
>   http://matplotlib.sourceforge.net/users/transforms_tutorial.html
> 
> Offset transformations are discussed at:
> 
>   
> http://matplotlib.sourceforge.net/users/transforms_tutorial.html#using-offset-transforms-to-create-a-shadow-effect
> 
> though in a different context, that of creating shadow effects.  The
> transformation logic is the same as in this case, though.

The case of wanting to offset text by an amount measured ideally in 
units of font size, or, failing that, in display units, is so common 
that it cries out for an easy-to-use syntax. e.g.,

text(x, y, "Honolulu", offset = (1, 1), offset_units='ex')

I think that allowing display units would be easy to implement (as 
indicated by Ryan's example), but font or physical units would be much 
trickier because they would involve draw-time determinations.  Starting 
by allowing only display units still would be much better than the 
present situation.

Collections already have something like this, with their offset and 
offset_transform kwargs, but they are still a little more difficult to 
use than what I am thinking of for text.

Eric


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to