1 Star 0 Fork 18

zhangdaolong/python-matplotlib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-matplotlibrc-path-search-fix.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
xu_ping 提交于 2022-02-08 19:53 . remove unuse files
From 60ab4094d885067c50694d2f11cd640dc5c0f0c6 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <[email protected]>
Date: Wed, 27 Sep 2017 19:35:59 -0400
Subject: [PATCH 1/2] matplotlibrc path search fix
Signed-off-by: Elliott Sales de Andrade <[email protected]>
---
lib/matplotlib/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 71c68a3d6b..88be8e97b0 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -473,7 +473,8 @@ def get_cachedir():
@_logged_cached('matplotlib data path: %s')
def get_data_path():
"""Return the path to Matplotlib data."""
- return str(Path(__file__).with_name("mpl-data"))
+ return str(Path(__file__).parent.parent.parent.parent.parent /
+ 'share/matplotlib/mpl-data')
def matplotlib_fname():
@@ -493,6 +494,7 @@ def matplotlib_fname():
is not defined)
- On other platforms,
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
+ - ``/etc/matplotlibrc``
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
exist.
"""
@@ -511,6 +513,7 @@ def matplotlib_fname():
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
yield os.path.join(get_configdir(), 'matplotlibrc')
+ yield '/etc/matplotlibrc'
yield os.path.join(get_data_path(), 'matplotlibrc')
for fname in gen_candidates():
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangdaolong/python-matplotlib.git
[email protected]:zhangdaolong/python-matplotlib.git
zhangdaolong
python-matplotlib
python-matplotlib
master

搜索帮助