[Andy Beardmore <apb@...389...>] matplotlib 0.63

I'm forwarding this question the to mailing list since other people
there may have additional insights....

Andy Beardmore wrote:

I finally bit the bullet and upgraded my laptop from mandrake 9.1 to
Ubuntu 4.01. I have been wanting a debian based distro on it for ages...

In the process I upgraded matplotlib from 0.61.x to 0.63.4.
I installed the python-matplotlib deb package linked to from the
matplotlib website, and finally managed to solve all the dependencies
in order to get matplotlib to work - there was a numarray
extension package that needed to be installed in addition to the main
numarray one.

Anyway, the upshot is matplotlib runs but it is not finding the
sans font and makes a poor substitute in its place. For exampe the output
from simple_demo.py is :

examples/simple_plot.py
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1077:
DeprecationWarning:
self.append_space()
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1077:
GtkWarning: mixing deprecated and non-deprecated GtkToolbar API is not
allowed
self.append_space()
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1080:
DeprecationWarning:
self.append_widget(self.message, '', '')
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1080:
GtkWarning: mixing deprecated and non-deprecated GtkToolbar API is not
allowed
self.append_widget(self.message, '', '')
Could not match sans-serif, normal, normal. Returning
/usr/share/matplotlib/cmmi10.ttf
Could not match sans-serif, normal, normal. Returning
/usr/share/matplotlib/cmmi10.ttf
Could not match sans-serif, normal, normal. Returning
/usr/share/matplotlib/cmmi10.ttf

Is there any way I can force it to use a better looking font ?
Or even find out what has happened to the sans-serif font?

Have you tried setting the TTFPATH environment variable to the paths where your other TTF fonts are located? It appears that the default font paths that matplotlib uses are not the ones used by Ubuntu. It might also be useful to print the FontManager.ttfdict attribute to see what fonts have actually been found.

-- Paul

···

--
Paul Barrett, PhD Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Branch
FAX: 410-338-4767 Baltimore, MD 21218

Hello,

Anyway, the upshot is matplotlib runs but it is not finding the
sans font and makes a poor substitute in its place. For exampe the output
from simple_demo.py is : ...

I think that this might be a bug in Vittorio's Debian packages.
There was a problem with the matplotlib font loading code which
made it only find fonts installed under /usr/share/matplotlib.
Since Debian hast the fonts under /usr/share/fonts they were not
found. Maybe this was not fixed in his packages?

You can try my alternative packages at http://seehuhn.de/debian/,
which hopefully work. Download python-matplotlib_0.63.4-2.1_i386.deb
from there and install it manually with e.g.

    dpkg -i python-matplotlib_0.63.4-2.1_i386.deb

I hope this helps,
Jochen

···

On Wed, 10 Nov 2004 16:26:47 +0000 (GMT) Andy Baerdmore wrote
--