The rcParams list seems to list all settings regardless of whether or not
they are defined in matplotlibrc.

If I want the figure.facecolor to be white unless the user defines it as
something else in his or her matplotlibrc file, is there an easy way to do
that short of opening up matplotlib_fname() and parsing it myself?

figure.facecolor in returns True despite the fact that it is not defined in
matplotlibrc.

The following works, but it seems like there should be an easier way of
doing this

        try:
            f = open(matplotlib.matplotlib_fname(),'r')
            settings = [ line.split(':')[0].strip() for line in
f.readlines() if not line.strip().startswith('#') and
line.split(':')[0].strip() != '' ]
            f.close()
            if not 'figure.facecolor' in settings:
                raise ValueError
        except:
            matplotlib.rcParams['figure.facecolor'] = '#FFFFFF'

Thanks,

- Rob Falck
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to