all fonts to sans-serif?

Hi,

I'd like to have all sub-fonts (labels, tick labels, text) sans-serif
for a series of plots per default. However the appropriate settings
in .matplotlibrc apparently don't work and this also does not work:

import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'sans-serif'
mpl.rcParams['font.sans-serif'] = 'Bitstream Vera Sans'

Any ideas?

TIA
Christian

usetex uses latex's math mode for rendering ticklabels, and mathmode
is rendered in serif. We tried supporting sans-serif once, and it
turned out to be too complicated to cover all the corner cases. I
think there may be a latex package that can be loaded for sans-serif
math mode, but I don't remember what it is called. You could add that
package invocation to your text.latex.preamble, but please note that
text.latex.preamble is not officially supported (because it is so
flexible, we don't want to troubleshoot latex issues on this list.)

Darren

···

On Thu, Oct 15, 2009 at 10:38 AM, Christian Meesters <meesters@...2757...> wrote:

Hi,

I'd like to have all sub-fonts (labels, tick labels, text) sans-serif
for a series of plots per default. However the appropriate settings
in .matplotlibrc apparently don't work and this also does not work:

import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'sans-serif'
mpl.rcParams['font.sans-serif'] = 'Bitstream Vera Sans'

Thanks Darren,

Then, I guess, the easiest solution is to either use to set all tick
labels manually or to just use serif fonts ;-).

Christian

···

On Fri, 2009-10-16 at 09:57 -0400, Darren Dale wrote:

On Thu, Oct 15, 2009 at 10:38 AM, Christian Meesters > <meesters@...2757...> wrote:
> Hi,
>
> I'd like to have all sub-fonts (labels, tick labels, text) sans-serif
> for a series of plots per default. However the appropriate settings
> in .matplotlibrc apparently don't work and this also does not work:
>
> import matplotlib as mpl
> mpl.rcParams['text.usetex'] = True
> mpl.rcParams['font.family'] = 'sans-serif'
> mpl.rcParams['font.sans-serif'] = 'Bitstream Vera Sans'

usetex uses latex's math mode for rendering ticklabels, and mathmode
is rendered in serif. We tried supporting sans-serif once, and it
turned out to be too complicated to cover all the corner cases. I
think there may be a latex package that can be loaded for sans-serif
math mode, but I don't remember what it is called. You could add that
package invocation to your text.latex.preamble, but please note that
text.latex.preamble is not officially supported (because it is so
flexible, we don't want to troubleshoot latex issues on this list.)

Darren