Skip to content

Commit 37007fd

Browse files
committed
matplotlibrc path search fix
1 parent 8b82729 commit 37007fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,8 @@ def get_cachedir():
590590
@_logged_cached('matplotlib data path: %s')
591591
def get_data_path():
592592
"""Return the path to Matplotlib data."""
593-
return str(Path(__file__).with_name("mpl-data"))
593+
return str(Path(__file__).parent.parent.parent.parent.parent /
594+
'share/matplotlib/mpl-data')
594595

595596

596597
def matplotlib_fname():
@@ -610,6 +611,7 @@ def matplotlib_fname():
610611
is not defined)
611612
- On other platforms,
612613
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
614+
- ``/etc/matplotlibrc``
613615
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
614616
exist.
615617
"""
@@ -628,6 +630,7 @@ def gen_candidates():
628630
yield matplotlibrc
629631
yield os.path.join(matplotlibrc, 'matplotlibrc')
630632
yield os.path.join(get_configdir(), 'matplotlibrc')
633+
yield '/etc/matplotlibrc'
631634
yield os.path.join(get_data_path(), 'matplotlibrc')
632635

633636
for fname in gen_candidates():

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy