math symbols with matplotlib basemap

Hi there,

I wonder if there is I way how to use math symbols together with the basemap class.

Here is my problem:

The lines

import matplotlib.pyplot as plt

plt.text(0.06 , 0.04, r"200 $\Omega$ m", fontsize=10, transform=plt.gca().transAxes)

work with a standard plot. However if I use basemap, I get the following error:

File “/usr/lib/pymodules/python2.6/matplotlib/”, line 280, in _get_layout

clean_line, self._fontproperties, ismath=ismath)

File “/usr/lib/pymodules/python2.6/matplotlib/backends/”, line 156, in get_text_width_height_descent

self.mathtext_parser.parse(s, self.dpi, prop)

“/usr/lib/pymodules/python2.6/matplotlib/”, line 2797, in parse

font_output = fontset_class(prop, backend)

File “/usr/lib/pymodules/python2.6/matplotlib/”, line 658, in init

self._stix_fallback = StixFonts(*args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/”, line 900, in init

fullpath = findfont(name)

File “/usr/lib/pymodules/python2.6/matplotlib/”, line 1306, in findfont

if not os.path.exists(font):

File “/usr/lib/python2.6/”, line 18, in exists

st = os.stat(path)

TypeError: coercing to Unicode: need string or buffer, dict found

Thank you
very much for your help!


I would try renaming the font cache file (in
~/.matplotlib/fontList.cache). It looks like it perhaps contains
some invalid data. If that works, can you send the old file to me
(off list) so I can try to get to the bottom of how it got



-- Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA