Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29bc9cf

Browse files
committed
Document get_cachedir() in troubleshooting
On unix-like systems, configuration directory and cache directory are normally different. Document how to locate cache dir in troubleshooting FAQ
1 parent 42a143c commit 29bc9cf

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

doc/faq/troubleshooting_faq.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ and printing the ``__file__`` attribute::
3434

3535
.. _locating-matplotlib-config-dir:
3636

37-
:file:`.matplotlib` directory location
38-
======================================
37+
:file:`.matplotlib` and `.cache` directory location
38+
===================================================
3939

4040
Each user has a matplotlib configuration directory which may contain a
4141
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file. To
@@ -47,18 +47,31 @@ locate your :file:`.matplotlib/` directory, use
4747
'/home/darren/.matplotlib'
4848

4949
On unix-like systems, this directory is generally located in your
50-
:envvar:`HOME` directory. On windows, it is in your documents and
51-
settings directory by default::
50+
:envvar:`HOME` directory.
51+
52+
In addition, users have a cache directory. On unix-like systems, this is
53+
separate to the configuration directory by default. To locate your
54+
:file:`.cache/` directory, use :func:`matplotlib.get_cachedir`::
55+
56+
>>> import matplotlib as mpl
57+
>>> mpl.get_cachedir()
58+
'/home/darren/.cache/matplotlib'
59+
60+
On windows, both the config directory and the cache directory are
61+
the same and are in your documents and settings directory by default::
5262

5363
>>> import matplotlib
5464
>>> mpl.get_configdir()
5565
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
66+
>>> mpl.get_cachedir()
67+
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
5668

5769
If you would like to use a different configuration directory, you can
5870
do so by specifying the location in your :envvar:`MPLCONFIGDIR`
5971
environment variable -- see
60-
:ref:`setting-linux-osx-environment-variables`.
61-
72+
:ref:`setting-linux-osx-environment-variables`. Note that
73+
:envvar:`MPLCONFIGDIR` sets the location of both the configuration
74+
directory and the cache directory.
6275

6376
.. _reporting-problems:
6477

0 commit comments

Comments
 (0)