Movatterモバイル変換


[0]ホーム

URL:


You are reading an old version of the documentation (v2.0.0). For the latest version seehttps://matplotlib.org/stable/faq/troubleshooting_faq.html
matplotlib

Navigation


Travis-CI:

Table Of Contents

Related Topics

This Page

Quick search

Troubleshooting

Obtaining matplotlib version

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.

Getting help

There are a number of good resources for getting help with matplotlib.There is a good chance your question has already been asked:

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 ofuname-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 yourmatplotlibrc file (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 averbose-helpful or--verbose-debug flags 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 tosetup.py orsetupext.py

  • the output of:

    rm-rfbuildpythonsetup.pybuild

    The 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.

Problems with recent git versions

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.

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2016 The Matplotlib development team. Last updated on Feb 20, 2017. Created usingSphinx 1.5.2.

[8]ページ先頭

©2009-2025 Movatter.jp