rsplotlib 0.1.4__tar.gz → 0.1.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.
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/.gitignore +1 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/Cargo.lock +1 -1
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/Cargo.toml +1 -1
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/PKG-INFO +21 -4
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/build_wheel.sh +6 -0
- rsplotlib-0.1.5/pyproject.toml +48 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/api.py +5 -6
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/gridspec.py +13 -2
- rsplotlib-0.1.5/python/rsplotlib/pyplot.py +996 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes.rs +305 -8
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_bounds.rs +68 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_render_elements.rs +117 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/elements.rs +45 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/figure.rs +21 -11
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/lib.rs +7 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/pyfuncs.rs +117 -13
- rsplotlib-0.1.4/pyproject.toml +0 -28
- rsplotlib-0.1.4/python/rsplotlib/pyplot.py +0 -545
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/.github/ci.yml +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/.github/release.yml +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/LICENSE +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/README.md +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/README_zh.md +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/__init__.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/_figure_defaults.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/_font_resolver.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/_rcparams.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/pylab.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/style.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/python/rsplotlib/ticker.py +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/rust-toolchain.toml +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_grid.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_legend.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_mesh.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axes_title.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/axis.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/colormap.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/colors.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/marker.rs +0 -0
- {rsplotlib-0.1.4 → rsplotlib-0.1.5}/src/text_utils.rs +0 -0
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rsplotlib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
6
13
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
7
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
-
Classifier: Operating System ::
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
9
18
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
10
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
20
|
+
Requires-Dist: pillow>=9.0 ; extra == 'dev'
|
|
21
|
+
Requires-Dist: numpy>=1.20 ; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest>=7.0 ; extra == 'test'
|
|
23
|
+
Requires-Dist: pillow>=9.0 ; extra == 'test'
|
|
24
|
+
Requires-Dist: numpy>=1.20 ; extra == 'test'
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Provides-Extra: test
|
|
11
27
|
License-File: LICENSE
|
|
12
28
|
Summary: A high-performance matplotlib-compatible plotting library powered by Rust
|
|
13
|
-
|
|
29
|
+
Keywords: plotting,matplotlib,visualization,rust,scientific
|
|
30
|
+
Author: YJ-Niu
|
|
14
31
|
License: MIT
|
|
15
32
|
Requires-Python: >=3.8
|
|
16
33
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
@@ -6,10 +6,16 @@ set -euo pipefail
|
|
|
6
6
|
|
|
7
7
|
RELEASE=true
|
|
8
8
|
OUT_DIR="wheelhouse"
|
|
9
|
+
cache_file="/Users/user/Desktop/rust_project/rsplotlib/python/rsplotlib/rsplotlib.cpython-313-darwin.so"
|
|
9
10
|
# 如果 wheelhouse 目录存在, 则删除
|
|
10
11
|
if [[ -d "$OUT_DIR" ]]; then
|
|
11
12
|
rm -rf "$OUT_DIR"
|
|
12
13
|
fi
|
|
14
|
+
# 如果 cache_file 目录存在, 则删除
|
|
15
|
+
if [[ -f "$cache_file" ]]; then
|
|
16
|
+
rm "$cache_file"
|
|
17
|
+
fi
|
|
18
|
+
|
|
13
19
|
# Default python executable; may be overridden by --python or positional arg
|
|
14
20
|
PYTHON_EXEC="python"
|
|
15
21
|
# Flag set when the user explicitly provided a Python executable
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.13,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rsplotlib"
|
|
7
|
+
version = "0.1.5"
|
|
8
|
+
description = "A high-performance matplotlib-compatible plotting library powered by Rust"
|
|
9
|
+
readme = "README_zh.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "YJ-Niu" },
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Rust",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
19
|
+
"Programming Language :: Python :: 3.8",
|
|
20
|
+
"Programming Language :: Python :: 3.9",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
26
|
+
"License :: OSI Approved :: MIT License",
|
|
27
|
+
"Operating System :: MacOS",
|
|
28
|
+
"Operating System :: Microsoft :: Windows",
|
|
29
|
+
"Operating System :: POSIX :: Linux",
|
|
30
|
+
"Topic :: Scientific/Engineering :: Visualization",
|
|
31
|
+
]
|
|
32
|
+
keywords = ["plotting", "matplotlib", "visualization", "rust", "scientific"]
|
|
33
|
+
dependencies = []
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
test = [
|
|
37
|
+
"pytest>=7.0",
|
|
38
|
+
"pillow>=9.0",
|
|
39
|
+
"numpy>=1.20",
|
|
40
|
+
]
|
|
41
|
+
dev = [
|
|
42
|
+
"pytest>=7.0",
|
|
43
|
+
"pillow>=9.0",
|
|
44
|
+
"numpy>=1.20",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.maturin]
|
|
48
|
+
python-source = "python"
|
|
@@ -301,7 +301,7 @@ def contourf(X, Y, Z, levels=None, cmap='coolwarm', alpha=1.0):
|
|
|
301
301
|
|
|
302
302
|
def stackplot(x, *args, labels=None, colors=None, alpha=1.0):
|
|
303
303
|
"""绘制堆叠面积图
|
|
304
|
-
|
|
304
|
+
|
|
305
305
|
Args:
|
|
306
306
|
x: x 轴数据
|
|
307
307
|
*args: 多个 y 数据数组
|
|
@@ -309,11 +309,10 @@ def stackplot(x, *args, labels=None, colors=None, alpha=1.0):
|
|
|
309
309
|
colors: 颜色列表 (默认: None)
|
|
310
310
|
alpha: 透明度 (默认: 1.0)
|
|
311
311
|
"""
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
return None
|
|
312
|
+
y_data = list(args) if args else []
|
|
313
|
+
if len(y_data) == 1 and isinstance(y_data[0], (list, tuple)) and y_data[0] and isinstance(y_data[0][0], (list, tuple)):
|
|
314
|
+
y_data = list(y_data[0])
|
|
315
|
+
return _rsplotlib.stackplot(_to_list(x), y_data, labels, colors, alpha)
|
|
317
316
|
|
|
318
317
|
|
|
319
318
|
# ==================== 辅助元素 ====================
|
|
@@ -78,8 +78,13 @@ class SubplotSpec:
|
|
|
78
78
|
self.row_end = row_end
|
|
79
79
|
self.col_start = col_start
|
|
80
80
|
self.col_end = col_end
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
if gridspec is not None:
|
|
82
|
+
self.numRows = gridspec.nrows
|
|
83
|
+
self.numCols = gridspec.ncols
|
|
84
|
+
else:
|
|
85
|
+
# 用于模式 (nrows, ncols, index) 调用 add_subplot
|
|
86
|
+
self.numRows = max(row_end, 1)
|
|
87
|
+
self.numCols = max(col_end, 1)
|
|
83
88
|
self.rowStart = row_start
|
|
84
89
|
self.rowStop = row_end
|
|
85
90
|
self.colStart = col_start
|
|
@@ -87,6 +92,12 @@ class SubplotSpec:
|
|
|
87
92
|
|
|
88
93
|
def get_position(self, figure):
|
|
89
94
|
"""返回子图位置 (left, bottom, width, height)"""
|
|
95
|
+
if self.gridspec is None:
|
|
96
|
+
# 没有 gridspec 时使用均匀划分
|
|
97
|
+
return (self.colStart / self.numCols,
|
|
98
|
+
1.0 - self.rowEnd / self.numRows,
|
|
99
|
+
(self.colEnd - self.colStart) / self.numCols,
|
|
100
|
+
(self.rowEnd - self.rowStart) / self.numRows)
|
|
90
101
|
row_heights = self.gridspec.height_ratios
|
|
91
102
|
col_widths = self.gridspec.width_ratios
|
|
92
103
|
|