Hi,
I just upgraded to matplotlib 0.98.1 on a ubuntu hardy heron system. I
have noticed two problems since the upgrade:
1) For any plot, if I try to look at the properties of a text object I
get an error related to FontProperties having no attribute 'items'. See
below:
In [1]: plot(range(10))
Out[1]: [<matplotlib.lines.Line2D object at 0x924f9ac>]
In [2]: xlh=get(gca(),'xticklabels')
In [3]: get(xlh[0])
collapse_curves.adult_cubic.frac_crit_0.50.eps (94.2 KB)
···
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
724, in get
return getp(o, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
716, in getp
print '\n'.join(insp.pprint_getters())
File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line
684, in pprint_getters
s = str(val)
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py",
line 681, in __str__
return self.get_fontconfig_pattern()
File "/usr/lib/python2.5/site-packages/matplotlib/font_manager.py",
line 737, in get_fontconfig_pattern
return generate_fontconfig_pattern(self)
File
"/usr/lib/python2.5/site-packages/matplotlib/fontconfig_pattern.py",
line 164, in generate_fontconfig_pattern
for key, val in d.items():
<type 'exceptions.AttributeError'>: 'FontProperties' object has no
attribute 'items'
2) I have noticed that the font used for the xticklabels and the font
used for the xlabel and contour labels appears to be different (example
attached). One appears to be serif and the other sans-serif. This
seems to be due to using tex for text rendering. I am not sure if this
also occurred before the update, but I didn't notice it previously.
Looking at the properties of the different text objects, it isn't
apparent that there should be a difference - both have font properties
that indicate sans-serif, but the text of tick labels appears to be
surrounded by $'s forcing it through the text parser, while that of the
contour labels is not. Is this difference normal or expected? Is there
a way around this? In particular, I would like to use sans-serif for
everything - is this possible while still using tex?
Thanks for the assistance.
Cheers,
David
--
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France
Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************