On Thu, Oct 28, 2010 at 1:11 PM, Christopher Barker
<chris.bar...@noaa.gov> wrote:
> On 10/25/10 1:41 PM, Daniel Hyams wrote:
>> It doesn't really insist on it right?  There are MATPLOTLIBDIR and
>> MPLCONFIGDIR environment variables.
>
>> You can set these env variables within your code, before import of
>> matplotlib via os.environment.
>
> I'm glad I've learned about this, and will start doing it with my
> bundled up apps -- but that does seem pretty un-pythonic -- shouldn't it
> be possible to set this sort of thing without resorting to that little
> round trip through environment variables?
>
> Not a big deal, but it feels kludgy.

The MPLCONFIGDIR tells mpl where to find the config file.  It's hard
to read the config, no matter how pythonic it is,  if you don't know
where it is.  Once the config file (matplotlibrc) is located  you can
set the datapath with the  'datapath' parameter so you don't need
MATPLOTLIBDATA (which is only used if datapath is not set).  From the
rc file:


  # Where your matplotlib data lives if you installed to a non-default
  # location.  This is where the matplotlib fonts, bitmaps, etc reside
  #datapath : /home/jdhunter/mpldata


We could use command line args, but mpl is a library and shouldn't
really be using them...  Arguably we are already doing too much in the
way of command line args.

JDH

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to