python plotting with greek symbols within labels recommendations?

Robert Kern robert.kern at gmail.com
Tue Oct 4 20:13:18 EDT 2005


michael.s.gilbert at gmail.com wrote:
> hello all,
> 
> this message is geared toward those of you in the scientific community.
> i'm looking for a python plotting library that can support rendering
> greek symbols and other various characters on plot axes labels, etc. I
> would prefer something that adheres to tex formatting (as implemented
> in latex, matlab, etc and has the form $\alpha$ to represent the greek
> character alpha for example).
> 
> thus far, i've found that matplotlib
> (http://matplotlib.sourceforge.net/) can do this, albeit the
> implementation is so poor that you cannot mix standard text with
> symbols on the same plot element.

And, incidentally, if you're only interested in letters and symbols
strung out horizontally with the Latin characters rather than formula
layout, you can use Unicode if your font supports it:

In [41]: s
Out[41]: u'This is \u0393reek to me'

In [42]: rc('font', serif=['Code2000'])

In [43]: title(s)

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list