On Wed, Sep 30, 2009 at 4:38 PM, Christopher Barrington-Leigh
<cpblpublic+nab...@gmail.com> wrote:
>
>
> Jae-Joon Lee wrote:
>>
>> This works if you use recent version of matplotlib with preview mode
>> on. Without the preview mode (or other similar ways to report the
>> dimension of the text from TeX side), I don't think this can be done.
>>
>>
>
> Ok, thanks. I hope I am understanding. Would you be able to point me to a
> link to info on what you mean by "preview mode"?
> By recent version you mean something in the svn, I guess?
>
>

0.99.0 and later should work.

text.usetex : True
text.latex.preview : True

Include these in your rc file. While the preview.sty is installed in
most tex distribution, you may need to install it if not.

>
>
>> This does not. First of all, "~" and "\mbox" are not supported if
>> usetex=False and I guess never will be. On the other hand,
>>  as far as I can see, the whitespace stripping is not done in mpl
>> side. And I have a feeling that it may be the freetype library. mpl
>> uses  FT_Glyph_Get_CBox to calculate the extents of the text and I
>> think this seems to fail when there is a trailing spaces. This is
>> beyond me I hope other developers have better idea.
>>
>>
>
> Thanks, I too hope some other developers chime in!
>
>
>
>> So, Christopher,
>> I guess your best chance is to upgrade and use preview mode, or use
>> annotate function.
>>
>
> I am not clear how annotate helps. If I am willing to specify x,y locations,
> I can do that with text() as well, no?. It's still a matter of calculating
> how big a piece of whitespace should end up, roughly.

annotate let you specify offset from (x, y).

annotate("test", (1., 0.5), (-20, 0), xycoords='data',
         textcoords='offset points', ha="right")

Check the documentation.

Regards,

-JJ


>
> Thanks, JJ!
>
>
> --
> View this message in context: 
> http://www.nabble.com/trailing-space-in-text-string-stripped%2C-making-it-impossible-to-right-pad-my-text-tp25639703p25688584.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to