EasyPlotLib 0.0.3__tar.gz → 0.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,21 @@
1
1
  import os
2
-
3
2
  import matplotlib.font_manager as fm
4
3
  import matplotlib.pyplot as plt
5
4
 
6
5
  from .cartopy_helper import cartopy_plot_tickmarks
7
6
  from .figsizes_set import figsizes, subplot_labels
7
+ import EasyPlotLib
8
8
 
9
- current_dir = os.path.dirname(os.path.abspath(__file__))
10
-
11
- font_dir = os.path.join(current_dir, "font")
9
+ # register the bundled stylesheets in the matplotlib style library
10
+ EasyPlotLib_path = EasyPlotLib.__path__[0]
11
+ style_dir = os.path.join(EasyPlotLib_path, "styles")
12
+ font_dir = os.path.join(EasyPlotLib_path, "fonts")
13
+ # 加载字体
12
14
  font_files = fm.findSystemFonts(fontpaths=[font_dir])
13
15
  for font_file in font_files:
14
16
  fm.fontManager.addfont(font_file)
15
17
 
16
- # register all mplstyle
17
- style_dir = os.path.join(current_dir, "styles")
18
+ # 注册所有 mplstyle
18
19
  stylesheets = {}
19
20
  for root, dirs, files in os.walk(style_dir):
20
21
  new_stylesheets = plt.style.core.read_style_directory(root)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: EasyPlotLib
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A simple plotting library
5
5
  Home-page: https://github.com/yourusername/EasyPlotLib
6
6
  Author: HanYuyang
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: EasyPlotLib
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: A simple plotting library
5
5
  Home-page: https://github.com/yourusername/EasyPlotLib
6
6
  Author: HanYuyang
File without changes
File without changes
File without changes