704b8e1
From c006ef7296abee22c3ec4ae1f3ee79bfa903471f Mon Sep 17 00:00:00 2001
c9345fa
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
c9345fa
Date: Wed, 27 Sep 2017 19:35:59 -0400
704b8e1
Subject: [PATCH 1/5] matplotlibrc path search fix
c9345fa
c9345fa
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
c9345fa
---
ca0fc90
 lib/matplotlib/__init__.py | 5 ++++-
ca0fc90
 1 file changed, 4 insertions(+), 1 deletion(-)
c9345fa
c9345fa
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
704b8e1
index 50033b212a..8639a44283 100644
c9345fa
--- a/lib/matplotlib/__init__.py
c9345fa
+++ b/lib/matplotlib/__init__.py
704b8e1
@@ -540,7 +540,8 @@ def get_cachedir():
ca0fc90
 @_logged_cached('matplotlib data path: %s')
ca0fc90
 def get_data_path():
ca0fc90
     """Return the path to Matplotlib data."""
ca0fc90
-    return str(Path(__file__).with_name("mpl-data"))
58b78d7
+    return str(Path(__file__).parent.parent.parent.parent.parent /
58b78d7
+               'share/matplotlib/mpl-data')
e6f3591
 
1dcb7af
 
ca0fc90
 def matplotlib_fname():
704b8e1
@@ -560,6 +561,7 @@ def matplotlib_fname():
9046bbb
           is not defined)
9046bbb
     - On other platforms,
e6f3591
       - ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
037e6ae
+    - ``/etc/matplotlibrc``
037e6ae
     - Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
037e6ae
       exist.
b11ac26
     """
704b8e1
@@ -578,6 +580,7 @@ def matplotlib_fname():
5ff9cbe
             yield matplotlibrc
5ff9cbe
             yield os.path.join(matplotlibrc, 'matplotlibrc')
1dcb7af
         yield os.path.join(get_configdir(), 'matplotlibrc')
5ff9cbe
+        yield '/etc/matplotlibrc'
ca0fc90
         yield os.path.join(get_data_path(), 'matplotlibrc')
12e8a62
 
5ff9cbe
     for fname in gen_candidates():
c9345fa
-- 
14bebd4
2.36.1
c9345fa