problem with usetex & \color

Sebastian Busch <webmaster@...2599...> writes:

I would have liked to get an aligned legend, like

d = 9m
d = 10m

In order to achieve that, i was trying to print a white (=invisible) "1"
whenever the number was smaller than 10 as spaceholder (I do not want to
use a monospaced font).

Does the \phantom trick work? I.e., r'd = \phantom{1}9m' or something
like that?

Obviously, this doesn't work any more as soon as you reach 20...

Even if your font is not monospaced, it might have "tabular figures":

http://www.fonts.com/aboutfonts/articles/fyti/propvstabfigures.htm

I think at least Computer Modern Roman (the default font in TeX) does
have tabular figures.

···

--
Jouni K. Sepp�nen
http://www.iki.fi/jks

As Jouni suggested, I guess the best chance here is to use phantom
command. Here is a little example.

rc('text', usetex=True)

p1, = plot([1,2,3])
legend([p1, p1, p1, p1],
       [r"d = $\phantom{0}1$ m", "d = $10$ m", "d = $23$ m", "d = $91$ m"])

-JJ

···

On Tue, May 12, 2009 at 6:52 AM, Jouni K. Seppänen <jks@...397...> wrote:

Sebastian Busch <webmaster@...2599...> writes:

I would have liked to get an aligned legend, like

d = 9m
d = 10m

In order to achieve that, i was trying to print a white (=invisible) "1"
whenever the number was smaller than 10 as spaceholder (I do not want to
use a monospaced font).

Does the \phantom trick work? I.e., r'd = \phantom{1}9m' or something
like that?

Obviously, this doesn't work any more as soon as you reach 20...

Even if your font is not monospaced, it might have "tabular figures":

http://www.fonts.com/aboutfonts/articles/fyti/propvstabfigures.htm

I think at least Computer Modern Roman (the default font in TeX) does
have tabular figures.

--
Jouni K. Seppänen
http://www.iki.fi/jks

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users