Hi Antonino,

If your using the version 0.90 (or SVN) of matplotlib you can also use
mathtext2.

To enable it, put these lines in your matplotlibrc file:
mathtext.mathtext2 : True
mathtext.nonascii  : FreeSerif.ttf # Or any unicode font

or, you can set it for your particular script:
rcParams['mathtext.mathtext2'] = True
rcParams['mathtext.nonascii'] = 'FreeSerif.ttf'

You can also set:
mathtext.rm     :   FreeSerif.ttf # Roman font
mathtext.it     :   FreeSerifItalic.ttf     # Text italic
mathtext.tt     :   FreeMono.ttf    # Typewriter (monospaced)
mathtext.mit    :   FreeSerifItalic.ttf     # Math italic
mathtext.cal    :   FreeSansOblique.ttf # Caligraphic

Beware that you have to have the freefonts installed on your system,
or in the mpl data-dir.

Best,
Edin

On 3/13/07, Antonino Ingargiola <[EMAIL PROTECTED]> wrote:
> Sorry for the previous mail I've hit Send for error before the mail
> was complete.
>
> Here it is the complete mail:
>
> Hi to the list,
>
> I'm using matplotlib to generate graphs during my master thesis. I
> want to thank all the developer for providing such flexible tool.
>
> In some plots I have to put greek letters (or sometimes small formulas)
> as axis label. I've found three way to accomplish this:
>
> 1. Use the unicode string: xlabel(u'Wavelength [μm]')
> 2. Use mathtext: xlabel(r'$\rm{Wavelength [\mu m]}$')
> 3. Use usetex: rc(text, usetex=True), xlabel(r'Wavelength [$\rm{\mu m}$]')
>
> I have some problem with each method, any hint is appreciated.
>
> 1. This method works ok as far as I choose a unicode font with the
> greek letters, for example:
>
>   rcParams['font.serif'] = 'DejaVu Serif'
>
> However with unicode strings I'm not able to do exponent and deponent
> text (i.e cm^-1)
>
> Methods 1. and 2. are more flexible, however I'm no able to to put the
> \mu character in roman fonts. I don't know if this is the intended
> behavior or if it's a bug...
>
> Furthermore, is there a simple way to set fontsize for all text
> elements (labels, title, ticklabels). Currently I'm doing:
>
> rcParams['font.size'] = 12
> rcParams['xtick.labelsize'] = 14
> rcParams['axes.titlesize'] = 16
> rcParams['axes.labelsize'] = 14
>
> The relative setting (large, small,...) seems to refer always to the
> default font size (set in matplotlibrc). Is there a way to set the
> font.size property and then update all the other relative values to
> reflect the change?
>
> Many thanks for any help.
>
>   ~ Antonio
> -------------------------------------------------------------------------
> 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
>
-------------------------------------------------------------------------
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