the following code used to work for me in matplotlib-0.98 to make a
simple scatter plot and change the font from the default font to
Helvetica (I am using mac os x).
import matplotlib.pyplot as plt
from matplotlib import rc
from scipy import *
from numpy import *
my_fig = plt.figure(figsize=(6,5), dpi=100)
x = rand(100)*300
y = rand(100)
plt.rcParams['xtick.direction'] = 'out'
plt.rcParams['ytick.direction'] = 'out'
c = 0.05*300.5
i recently upgraded to matplotlib-0.99 and the changing of the font
using the above method no longer works. the figure is plotted the
same, but the font remains the default matplotlib font.
one potential problem in the installation was this: i installed
matplotlib-0.99 using the dmg prepackaged binary installer. this
installed matplotlib in the directory:
however, for some reason ipython / python2.5 was looking for packages in:
and so matplotlib/mpl_toolkits was not found. so I copied the
directories 'matplotlib' and 'mpl_toolkits' from
to /Library/Python/2.5/site-packages. Perhaps this was the cause of
thanks for your help.
(i run my code via ipython, by the way.)