I'm using matplotlib in an application I distribute. For Windows and Mac
users I distribute a frozen application which includes python,
matplotlib, etc. and I'm wondering how best to include the matplotlib
matplotlib searches for its data files in __init__._get_data_path. It
seems to search shared locations first, then locations that would be
relevant to a frozen application. Is that safe? I worry that if a user
of my app has their own version of matplotlib (possibly a very different
version than I've included) then the data files might be different.
If this really is an issue, then what to do?
For Mac I can put the data files deep in the app in
Contents/Frameworks/Python.Framework/2.4/share/matplotlib, which is the
second location looked at (after environment variable MATPLOTLIBDATA).
For Windows, there doesn't seem any way out. The Windows frozen test is
Also, should I worry about the user's local matplotlibrc file (which
again might be for the wrong version or might never have been created or
configured at all -- the main problem I've hit so far is that the
auto-created default of this file is always wrong about the back
end--picking gtkagg even though I don't even build gtk support).
Again, that looks difficult or impossible because the search order is
for the usual user locations first, then look in the data directory.
Any advice would be most appreciated.