EasyPlotLib 0.0.4__tar.gz → 0.0.6__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.
- easyplotlib-0.0.6/EasyPlotLib/__init__.py +29 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/EasyPlotLib.egg-info/PKG-INFO +1 -1
- easyplotlib-0.0.6/EasyPlotLib.egg-info/SOURCES.txt +9 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/PKG-INFO +1 -1
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/setup.py +0 -7
- easyplotlib-0.0.4/EasyPlotLib/__init__.py +0 -25
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreadventor-bold.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreadventor-bolditalic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreadventor-italic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreadventor-regular.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyrechorus-mediumitalic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyrecursor-bold.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyrecursor-bolditalic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyrecursor-italic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyrecursor-regular.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreheros-bold.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreheros-bolditalic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreheros-italic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreheros-regular.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreschola-bold.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreschola-bolditalic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreschola-italic.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/font/texgyreschola-regular.ttf +0 -0
- easyplotlib-0.0.4/EasyPlotLib/styles/nature.mplstyle +0 -57
- easyplotlib-0.0.4/EasyPlotLib.egg-info/SOURCES.txt +0 -27
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/EasyPlotLib/cartopy_helper.py +0 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/EasyPlotLib/figsizes_set.py +0 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/EasyPlotLib.egg-info/dependency_links.txt +0 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/EasyPlotLib.egg-info/top_level.txt +0 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/README.md +0 -0
- {easyplotlib-0.0.4 → easyplotlib-0.0.6}/setup.cfg +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import matplotlib.font_manager as fm
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
|
|
5
|
+
from .cartopy_helper import cartopy_plot_tickmarks
|
|
6
|
+
from .figsizes_set import figsizes, subplot_labels
|
|
7
|
+
import EasyPlotLib
|
|
8
|
+
|
|
9
|
+
# register the bundled stylesheets in the matplotlib style library
|
|
10
|
+
EasyPlotLib_path = EasyPlotLib.__path__[0]
|
|
11
|
+
font_dir = os.path.join(EasyPlotLib_path, "fonts")
|
|
12
|
+
styles_path = os.path.join(EasyPlotLib_path, "styles")
|
|
13
|
+
|
|
14
|
+
# add fonts
|
|
15
|
+
font_files = fm.findSystemFonts(fontpaths=[font_dir])
|
|
16
|
+
for font_file in font_files:
|
|
17
|
+
fm.fontManager.addfont(font_file)
|
|
18
|
+
|
|
19
|
+
# Reads styles in /styles folder and all subfolders
|
|
20
|
+
stylesheets = {} # plt.style.library is a dictionary
|
|
21
|
+
for folder, _, _ in os.walk(styles_path):
|
|
22
|
+
new_stylesheets = plt.style.core.read_style_directory(folder)
|
|
23
|
+
stylesheets.update(new_stylesheets)
|
|
24
|
+
|
|
25
|
+
# Update dictionary of styles - plt.style.library
|
|
26
|
+
plt.style.core.update_nested_dict(plt.style.library, stylesheets)
|
|
27
|
+
# Update `plt.style.available`, copy-paste from:
|
|
28
|
+
# https://github.com/matplotlib/matplotlib/blob/a170539a421623bb2967a45a24bb7926e2feb542/lib/matplotlib/style/core.py#L266 # noqa: E501
|
|
29
|
+
plt.style.core.available[:] = sorted(plt.style.library.keys())
|
|
@@ -25,13 +25,6 @@ setuptools.setup(
|
|
|
25
25
|
long_description_content_type="text/markdown",
|
|
26
26
|
url="https://github.com/yourusername/EasyPlotLib",
|
|
27
27
|
packages=setuptools.find_packages(),
|
|
28
|
-
package_data={
|
|
29
|
-
"EasyPlotLib": [
|
|
30
|
-
"font/*.ttf",
|
|
31
|
-
"styles/*.mplstyle",
|
|
32
|
-
"styles/journals/*", # 如果 journals 目录下有文件也要包含的话
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
28
|
classifiers=[
|
|
36
29
|
"Programming Language :: Python :: 3",
|
|
37
30
|
"Operating System :: OS Independent",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import matplotlib.font_manager as fm
|
|
3
|
-
import matplotlib.pyplot as plt
|
|
4
|
-
import pkg_resources
|
|
5
|
-
|
|
6
|
-
from .cartopy_helper import cartopy_plot_tickmarks
|
|
7
|
-
from .figsizes_set import figsizes, subplot_labels
|
|
8
|
-
|
|
9
|
-
# 获取资源目录的路径,假设 'fonts' 和 'styles' 目录已经在你的包数据中
|
|
10
|
-
font_dir = pkg_resources.resource_filename(__name__, "fonts")
|
|
11
|
-
style_dir = pkg_resources.resource_filename(__name__, "styles")
|
|
12
|
-
|
|
13
|
-
# 加载字体
|
|
14
|
-
font_files = fm.findSystemFonts(fontpaths=[font_dir])
|
|
15
|
-
for font_file in font_files:
|
|
16
|
-
fm.fontManager.addfont(font_file)
|
|
17
|
-
|
|
18
|
-
# 注册所有 mplstyle
|
|
19
|
-
stylesheets = {}
|
|
20
|
-
for root, dirs, files in os.walk(style_dir):
|
|
21
|
-
new_stylesheets = plt.style.core.read_style_directory(root)
|
|
22
|
-
stylesheets.update(new_stylesheets)
|
|
23
|
-
|
|
24
|
-
plt.style.core.update_nested_dict(plt.style.library, stylesheets)
|
|
25
|
-
plt.style.core.available[:] = sorted(plt.style.library.keys())
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Matplotlib style for EasyPlotlib
|
|
2
|
-
|
|
3
|
-
# Set color cycle: blue, green, yellow, red, violet, gray
|
|
4
|
-
axes.prop_cycle : cycler('color', ['0C5DA5', '00B945', 'FF9500', 'FF2C00', '845B97', '474747', '9e9e9e'])
|
|
5
|
-
|
|
6
|
-
# figure.figsize : 3.5, 2.625
|
|
7
|
-
|
|
8
|
-
# Set x axis
|
|
9
|
-
xtick.direction : in
|
|
10
|
-
xtick.major.size : 3
|
|
11
|
-
xtick.major.width : 0.5
|
|
12
|
-
xtick.minor.size : 1.5
|
|
13
|
-
xtick.minor.width : 0.5
|
|
14
|
-
xtick.minor.visible : True
|
|
15
|
-
xtick.top : True
|
|
16
|
-
|
|
17
|
-
# Set y axis
|
|
18
|
-
ytick.direction : in
|
|
19
|
-
ytick.major.size : 3
|
|
20
|
-
ytick.major.width : 0.5
|
|
21
|
-
ytick.minor.size : 1.5
|
|
22
|
-
ytick.minor.width : 0.5
|
|
23
|
-
ytick.minor.visible : True
|
|
24
|
-
ytick.right : True
|
|
25
|
-
|
|
26
|
-
# Set line widths
|
|
27
|
-
axes.linewidth : 0.5
|
|
28
|
-
grid.linewidth : 0.5
|
|
29
|
-
lines.linewidth : 1.
|
|
30
|
-
lines.markersize: 3
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# Remove legend frame
|
|
34
|
-
legend.frameon : False
|
|
35
|
-
|
|
36
|
-
# Always save as 'tight'
|
|
37
|
-
savefig.bbox : tight
|
|
38
|
-
savefig.pad_inches : 0.05
|
|
39
|
-
|
|
40
|
-
# Font sizes
|
|
41
|
-
axes.labelsize: 7
|
|
42
|
-
xtick.labelsize: 7
|
|
43
|
-
ytick.labelsize: 7
|
|
44
|
-
legend.fontsize: 7
|
|
45
|
-
font.size: 7
|
|
46
|
-
|
|
47
|
-
# Custom font settings
|
|
48
|
-
font.sans-serif: TeX Gyre Heros
|
|
49
|
-
font.serif: TeX Gyre Schola
|
|
50
|
-
font.cursive: TeX Gyre Chorus
|
|
51
|
-
font.fantasy: TeX Gyre Adventor
|
|
52
|
-
font.monospace: TeX Gyre Cursor
|
|
53
|
-
|
|
54
|
-
font.family: sans-serif
|
|
55
|
-
mathtext.fontset : dejavuserif
|
|
56
|
-
|
|
57
|
-
axes.formatter.use_mathtext : True
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
README.md
|
|
2
|
-
setup.py
|
|
3
|
-
EasyPlotLib/__init__.py
|
|
4
|
-
EasyPlotLib/cartopy_helper.py
|
|
5
|
-
EasyPlotLib/figsizes_set.py
|
|
6
|
-
EasyPlotLib.egg-info/PKG-INFO
|
|
7
|
-
EasyPlotLib.egg-info/SOURCES.txt
|
|
8
|
-
EasyPlotLib.egg-info/dependency_links.txt
|
|
9
|
-
EasyPlotLib.egg-info/top_level.txt
|
|
10
|
-
EasyPlotLib/font/texgyreadventor-bold.ttf
|
|
11
|
-
EasyPlotLib/font/texgyreadventor-bolditalic.ttf
|
|
12
|
-
EasyPlotLib/font/texgyreadventor-italic.ttf
|
|
13
|
-
EasyPlotLib/font/texgyreadventor-regular.ttf
|
|
14
|
-
EasyPlotLib/font/texgyrechorus-mediumitalic.ttf
|
|
15
|
-
EasyPlotLib/font/texgyrecursor-bold.ttf
|
|
16
|
-
EasyPlotLib/font/texgyrecursor-bolditalic.ttf
|
|
17
|
-
EasyPlotLib/font/texgyrecursor-italic.ttf
|
|
18
|
-
EasyPlotLib/font/texgyrecursor-regular.ttf
|
|
19
|
-
EasyPlotLib/font/texgyreheros-bold.ttf
|
|
20
|
-
EasyPlotLib/font/texgyreheros-bolditalic.ttf
|
|
21
|
-
EasyPlotLib/font/texgyreheros-italic.ttf
|
|
22
|
-
EasyPlotLib/font/texgyreheros-regular.ttf
|
|
23
|
-
EasyPlotLib/font/texgyreschola-bold.ttf
|
|
24
|
-
EasyPlotLib/font/texgyreschola-bolditalic.ttf
|
|
25
|
-
EasyPlotLib/font/texgyreschola-italic.ttf
|
|
26
|
-
EasyPlotLib/font/texgyreschola-regular.ttf
|
|
27
|
-
EasyPlotLib/styles/nature.mplstyle
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|