how to set font for ipython matplotlib/pylab?
Question: I set my font for matplotlib to be a ttf through `~/.matplotlib/matplotlibrc`.
When I run:

` $ python myplot.py `

it uses the correct font. but if I do:

$ ipython --pylab Python 2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21
2014, 15:21:46) Type "copyright", "credits" or "license" for more information.

    
    
    IPython 2.2.0 -- An enhanced Interactive Python.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: http://continuum.io/thanks and https://binstar.org
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    In [1]: %run myplot
    

it does not use the font. I'm using Anaconda Python on Mac OS X. My `rcParams`
are not read. Does ipython (with pylab option) use a different configuration?
How can I set my matplotlib default font?

to add to the confusion, if I use `plt.show()` in ipython, it by default uses
one font, but if I `plt.savefig()` from ipython, it uses another.


Answer: As far as I know setting rcParams in the code itself before plotting is the
best approach. IPython does a lot of magic with its inlining which tends to be
very weird. Chances are that IPython tramples your rcParams with its own
default values, if you set them in your script, the interpreter will read them
in again.

    
    
    from matplotlib import rcParams
    rcParams['font.family'] = 'sans-serif'
    rcParams['font.sans-serif'] = ['Bitstream Vera Sans']
    rcParams['font.serif'] = ['Bitstream Vera Sans']
    rcParams["font.size"] = "40"
    

Try this at the top of the script and report back? Additionally you can try to
run your script as `ipython script.py --pylab`. Issue could also be that
you're updating your script outside IPython which could still be running byte-
compiled code from a previous version. (although not a big chance)

