
Contents
To find out your matplotlib version number, import it and print the__version__ attribute:
>>>importmatplotlib>>>matplotlib.__version__'0.98.0'
matplotlib install location¶You can find what directory matplotlib is installed in by importing itand printing the__file__ attribute:
>>>importmatplotlib>>>matplotlib.__file__'/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'
matplotlib configuration and cache directory locations¶Each user has a matplotlib configuration directory which may contain amatplotlibrc file. Tolocate yourmatplotlib/ configuration directory, usematplotlib.get_configdir():
>>>importmatplotlibasmpl>>>mpl.get_configdir()'/home/darren/.config/matplotlib'
On unix-like systems, this directory is generally located in yourHOME directory under the.config/ directory.
In addition, users have a cache directory. On unix-like systems, this isseparate from the configuration directory by default. To locate your.cache/ directory, usematplotlib.get_cachedir():
>>>importmatplotlibasmpl>>>mpl.get_cachedir()'/home/darren/.cache/matplotlib'
On windows, both the config directory and the cache directory arethe same and are in yourDocumentsandSettings orUsersdirectory by default:
>>>importmatplotlibasmpl>>>mpl.get_configdir()'C:\\Documents and Settings\\jdhunter\\.matplotlib'>>>mpl.get_cachedir()'C:\\Documents and Settings\\jdhunter\\.matplotlib'
If you would like to use a different configuration directory, you cando so by specifying the location in yourMPLCONFIGDIRenvironment variable – seeSetting environment variables in Linux and OS-X. Note thatMPLCONFIGDIR sets the location of both the configurationdirectory and the cache directory.
There are a number of good resources for getting help with matplotlib.There is a good chance your question has already been asked:
- Themailing list archive.
- Github issues.
- Stackoverflow questions taggedmatplotlib.
If you are unable to find an answer to your question through search,please provide the following information in your e-mail to themailing list:
your operating system; (Linux/UNIX users: post the output of
uname-a)matplotlib version:
python -c `import matplotlib; print matplotlib.__version__`where you obtained matplotlib (e.g., your Linux distribution’spackages, github, PyPi, orAnaconda orEnthought Canopy).
any customizations to your
matplotlibrcfile (seeCustomizing matplotlib).if the problem is reproducible, please try to provide aminimal,standalone Python script that demonstrates the problem. This isthe critical step. If you can’t post a piece of code that wecan run and reproduce your error, the chances of getting help aresignificantly diminished. Very often, the mere act of trying tominimize your code to the smallest bit that produces the errorwill help you find a bug inyour code that is causing theproblem.
you can get very helpful debugging output from matlotlib byrunning your script with a
verbose-helpfulor--verbose-debugflags and posting the verbose output thelists:>pythonsimple_plot.py--verbose-helpful>output.txt
If you compiled matplotlib yourself, please also provide
any changes you have made to
setup.pyorsetupext.pythe output of:
rm-rfbuildpythonsetup.pybuildThe beginning of the build output contains lots of details about yourplatform that are useful for the matplotlib developers to diagnoseyour problem.
your compiler version – e.g.,
gcc--version
Including this information in your first e-mail to the mailing listwill save a lot of time.
You will likely get a faster response writing to the mailing list thanfiling a bug in the bug tracker. Most developers check the bugtracker only periodically. If your problem has been determined to bea bug and can not be quickly solved, you may be asked to file a bug inthe tracker so the issue doesn’t get lost.
First make sure you have a clean build and install (seeHow to completely remove matplotlib), get the latest git update, install it and run asimple test script in debug mode:
rm-rfbuildrm-rf/path/to/site-packages/matplotlib*gitpullpythonsetup.pyinstall>build.outpythonexamples/pylab_examples/simple_plot.py--verbose-debug>run.out
and postbuild.out andrun.out to thematplotlib-develmailing list (please do not post git problems to theusers list).
Of course, you will want to clearly describe your problem, what youare expecting and what you are getting, but often a clean build andinstall will help. See alsoGetting help.