gsplot 0.0.1__tar.gz → 0.0.2__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.
- {gsplot-0.0.1 → gsplot-0.0.2}/PKG-INFO +10 -11
- {gsplot-0.0.1 → gsplot-0.0.2}/README.md +9 -10
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/figure/axes.py +2 -2
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/figure/axes_base.py +6 -2
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/style/label.py +11 -6
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/style/ticks.py +8 -8
- gsplot-0.0.2/gsplot/version.py +2 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/pyproject.toml +1 -1
- gsplot-0.0.1/gsplot/version.py +0 -2
- {gsplot-0.0.1 → gsplot-0.0.2}/LICENSE +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/__init__.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/base/base.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/base/base_alias_validator.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/color/colormap.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/config/config.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/data/load_file.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/figure/figure_tools.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/figure/show.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/figure/store.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/hello_world/hello_world.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/logger.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/path/path.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/line.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/line_base.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/line_colormap_base.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/line_colormap_dashed.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/line_colormap_solid.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/scatter.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/plot/scatter_colormap.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/style/graph.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/style/legend.py +0 -0
- {gsplot-0.0.1 → gsplot-0.0.2}/gsplot/style/legend_colormap.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gsplot
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: General-scientific plot based on matplotlib
|
|
5
5
|
Author: Giordano Mattoni
|
|
6
6
|
Author-email: mattoni@scphys.kyoto-u.ac.jp
|
|
@@ -18,15 +18,17 @@ Requires-Dist: types-pyyaml (>=6.0.12.20240917,<7.0.0.0)
|
|
|
18
18
|
Project-URL: Homepage, https://soichiroyamane.github.io/gsplot/
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
|
|
21
|
-
# gsplot 📈
|
|
22
|
-
|
|
23
21
|
<div align="center">
|
|
24
|
-
<img src="docs/_static/
|
|
22
|
+
<img src="docs/_static/logo_title_gsplot.png" alt="logo_gsplot" width="300">
|
|
25
23
|
</div>
|
|
26
24
|
|
|
27
25
|
[](https://github.com/SoichiroYamane/gsplot/actions/workflows/gh-pages-sphinx.yml)
|
|
28
|
-

|
|
27
|
+

|
|
28
|
+

|
|
29
29
|

|
|
30
|
+

|
|
31
|
+
|
|
30
32
|
----------------
|
|
31
33
|
|
|
32
34
|
<p align="center" style="font-weight: bold; font-size: 1.2em; margin: 20px 0;">
|
|
@@ -39,7 +41,7 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
39
41
|
|
|
40
42
|
## Features ✨
|
|
41
43
|
|
|
42
|
-
- **Better Plot, Less Code**: Simplify the process of creating high-quality figures
|
|
44
|
+
- **Better Plot, Less Code**: Simplify the process of creating high-quality figures ⚛️
|
|
43
45
|
- **Compatibility**: Compatible with [matplotlib](https://matplotlib.org) 📊
|
|
44
46
|
- **Customization**: Customize your configuration to fit your needs 🎨
|
|
45
47
|
- **Reproducibility**: Save your package status to make plots reproducible 📦
|
|
@@ -48,11 +50,12 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
48
50
|
|
|
49
51
|
[See more details](https://soichiroyamane.github.io/gsplot/guides/demo/4_paper_plot.html)
|
|
50
52
|
|
|
51
|
-

|
|
52
54
|
|
|
53
55
|
### Example with Python REPL 🐍 and neovim 🌟
|
|
54
56
|
|
|
55
57
|
[See more details](https://soichiroyamane.github.io/gsplot/guides/demo/13_REPL.html)
|
|
58
|
+
|
|
56
59
|

|
|
57
60
|
|
|
58
61
|
## Getting Started 🚀
|
|
@@ -61,10 +64,6 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
61
64
|
|
|
62
65
|
To use **gsplot**, ensure that you have `Python 3.10+` installed. You can install the package using `pip`:
|
|
63
66
|
|
|
64
|
-
#### important
|
|
65
|
-
|
|
66
|
-
**⚠️ This package has not been published yet**
|
|
67
|
-
|
|
68
67
|
```bash
|
|
69
68
|
pip install gsplot
|
|
70
69
|
```
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
# gsplot 📈
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
|
-
<img src="docs/_static/
|
|
2
|
+
<img src="docs/_static/logo_title_gsplot.png" alt="logo_gsplot" width="300">
|
|
5
3
|
</div>
|
|
6
4
|
|
|
7
5
|
[](https://github.com/SoichiroYamane/gsplot/actions/workflows/gh-pages-sphinx.yml)
|
|
8
|
-

|
|
7
|
+

|
|
8
|
+

|
|
9
9
|

|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
----------------
|
|
11
13
|
|
|
12
14
|
<p align="center" style="font-weight: bold; font-size: 1.2em; margin: 20px 0;">
|
|
@@ -19,7 +21,7 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
19
21
|
|
|
20
22
|
## Features ✨
|
|
21
23
|
|
|
22
|
-
- **Better Plot, Less Code**: Simplify the process of creating high-quality figures
|
|
24
|
+
- **Better Plot, Less Code**: Simplify the process of creating high-quality figures ⚛️
|
|
23
25
|
- **Compatibility**: Compatible with [matplotlib](https://matplotlib.org) 📊
|
|
24
26
|
- **Customization**: Customize your configuration to fit your needs 🎨
|
|
25
27
|
- **Reproducibility**: Save your package status to make plots reproducible 📦
|
|
@@ -28,11 +30,12 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
28
30
|
|
|
29
31
|
[See more details](https://soichiroyamane.github.io/gsplot/guides/demo/4_paper_plot.html)
|
|
30
32
|
|
|
31
|
-

|
|
32
34
|
|
|
33
35
|
### Example with Python REPL 🐍 and neovim 🌟
|
|
34
36
|
|
|
35
37
|
[See more details](https://soichiroyamane.github.io/gsplot/guides/demo/13_REPL.html)
|
|
38
|
+
|
|
36
39
|

|
|
37
40
|
|
|
38
41
|
## Getting Started 🚀
|
|
@@ -41,10 +44,6 @@ Welcome to **gsplot** (general-scientific plot), a toolkit designed to enhance t
|
|
|
41
44
|
|
|
42
45
|
To use **gsplot**, ensure that you have `Python 3.10+` installed. You can install the package using `pip`:
|
|
43
46
|
|
|
44
|
-
#### important
|
|
45
|
-
|
|
46
|
-
**⚠️ This package has not been published yet**
|
|
47
|
-
|
|
48
47
|
```bash
|
|
49
48
|
pip install gsplot
|
|
50
49
|
```
|
|
@@ -171,7 +171,7 @@ class AxesHandler(Generic[_T]):
|
|
|
171
171
|
Indicates whether shared storage is used.
|
|
172
172
|
size : list of int or float
|
|
173
173
|
The size of the figure in the specified unit.
|
|
174
|
-
unit :
|
|
174
|
+
unit : {"mm", "cm", "in", "pt"}
|
|
175
175
|
The unit for the figure size.
|
|
176
176
|
mosaic : str or list of HashableList[_T] or list of HashableList[Hashable]
|
|
177
177
|
The mosaic layout for subplots.
|
|
@@ -312,7 +312,7 @@ def axes(
|
|
|
312
312
|
Whether to use a shared storage for axes or figure states (default is False).
|
|
313
313
|
size : list of int or float, optional
|
|
314
314
|
The size of the figure in the specified unit (default is [5, 5]).
|
|
315
|
-
unit :
|
|
315
|
+
unit : {"mm", "cm", "in", "pt"}, optional
|
|
316
316
|
The unit for the figure size. Supported units are "mm", "cm", "in", and "pt" (default is "in").
|
|
317
317
|
mosaic : str or list of HashableList[_T] or list of HashableList[Hashable], optional
|
|
318
318
|
The mosaic layout for subplots. Can be a string or a list of hashable items (default is "A").
|
|
@@ -105,10 +105,14 @@ class AxesResolver:
|
|
|
105
105
|
except IndexError:
|
|
106
106
|
error_message = f"Axes out of range: {self._axis_index} => Number of axes: {len(axes)}, but requested {ordinal_suffix(self._axis_index + 1)} axis."
|
|
107
107
|
raise IndexError(error_message)
|
|
108
|
-
|
|
109
108
|
elif isinstance(self.axis_target, Axes):
|
|
110
109
|
self._axis = self.axis_target
|
|
111
|
-
self.
|
|
110
|
+
if self.axis_target in plt.gcf().axes:
|
|
111
|
+
self._axis_index = plt.gcf().axes.index(self._axis)
|
|
112
|
+
else:
|
|
113
|
+
# Add the axis to the current figure if it is not present
|
|
114
|
+
plt.gcf().add_axes(self._axis)
|
|
115
|
+
self._axis_index = len(plt.gcf().axes) - 1
|
|
112
116
|
else:
|
|
113
117
|
raise ValueError(
|
|
114
118
|
"Invalid axis target. Please provide an integer or Axes object."
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import warnings
|
|
1
2
|
from functools import wraps
|
|
2
3
|
from typing import Any, Callable, Literal, TypeVar, cast
|
|
3
4
|
|
|
@@ -778,12 +779,16 @@ class Label:
|
|
|
778
779
|
def apply_tight_layout(self) -> None:
|
|
779
780
|
|
|
780
781
|
if self.tight_layout:
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
)
|
|
785
|
-
|
|
786
|
-
|
|
782
|
+
# Ignore this warning when using inset_axes:
|
|
783
|
+
# UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect
|
|
784
|
+
with warnings.catch_warnings():
|
|
785
|
+
warnings.simplefilter("ignore")
|
|
786
|
+
try:
|
|
787
|
+
plt.tight_layout(
|
|
788
|
+
w_pad=self.x_pad, h_pad=self.y_pad, *self.args, **self.kwargs
|
|
789
|
+
)
|
|
790
|
+
except Exception:
|
|
791
|
+
plt.tight_layout(w_pad=self.x_pad, h_pad=self.y_pad)
|
|
787
792
|
|
|
788
793
|
def label(self) -> None:
|
|
789
794
|
|
|
@@ -47,13 +47,13 @@ class MinorTicks:
|
|
|
47
47
|
self.axis_index: int = _axes_resolver.axis_index
|
|
48
48
|
self.axis: Axes = _axes_resolver.axis
|
|
49
49
|
|
|
50
|
-
def set_minor_ticks_off(self, mode
|
|
50
|
+
def set_minor_ticks_off(self, mode: Literal["x", "y", "xy"] = "xy") -> None:
|
|
51
51
|
"""
|
|
52
52
|
Turn off minor ticks for the specified axis.
|
|
53
53
|
|
|
54
54
|
Parameters
|
|
55
55
|
--------------------
|
|
56
|
-
mode :
|
|
56
|
+
mode : {"x", "y", "xy"}, optional
|
|
57
57
|
Specifies the axis to configure. 'x' for x-axis, 'y' for y-axis,
|
|
58
58
|
and 'xy' for both axes. Default is 'xy'.
|
|
59
59
|
"""
|
|
@@ -67,13 +67,13 @@ class MinorTicks:
|
|
|
67
67
|
else:
|
|
68
68
|
raise ValueError("Invalid mode. Choose from 'x', 'y', or 'xy'.")
|
|
69
69
|
|
|
70
|
-
def set_minor_ticks_on(self, mode
|
|
70
|
+
def set_minor_ticks_on(self, mode: Literal["x", "y", "xy"] = "xy") -> None:
|
|
71
71
|
"""
|
|
72
72
|
Turn on minor ticks for the specified axis.
|
|
73
73
|
|
|
74
74
|
Parameters
|
|
75
75
|
--------------------
|
|
76
|
-
mode :
|
|
76
|
+
mode : {"x", "y", "xy"}, optional
|
|
77
77
|
Specifies the axis to configure. 'x' for x-axis, 'y' for y-axis,
|
|
78
78
|
and 'xy' for both axes. Default is 'xy'.
|
|
79
79
|
"""
|
|
@@ -112,7 +112,7 @@ class MinorTicksAxes:
|
|
|
112
112
|
axis.yaxis.set_minor_locator(plticker.AutoMinorLocator())
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
def ticks_off(axis_target: int | Axes, mode
|
|
115
|
+
def ticks_off(axis_target: int | Axes, mode: Literal["x", "y", "xy"] = "xy") -> None:
|
|
116
116
|
"""
|
|
117
117
|
Turn off minor ticks for the specified axis.
|
|
118
118
|
|
|
@@ -120,7 +120,7 @@ def ticks_off(axis_target: int | Axes, mode=Literal["x", "y", "xy"]) -> None:
|
|
|
120
120
|
--------------------
|
|
121
121
|
axis_target : int | Axes
|
|
122
122
|
The target axis for minor tick configuration.
|
|
123
|
-
mode :
|
|
123
|
+
mode : {"x", "y", "xy"}, optional
|
|
124
124
|
Specifies the axis to configure. 'x' for x-axis, 'y' for y-axis,
|
|
125
125
|
and 'xy' for both axes. Default is 'xy'.
|
|
126
126
|
|
|
@@ -133,7 +133,7 @@ def ticks_off(axis_target: int | Axes, mode=Literal["x", "y", "xy"]) -> None:
|
|
|
133
133
|
MinorTicks(axis_target).set_minor_ticks_off(mode)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
def ticks_on(axis_target: int | Axes, mode
|
|
136
|
+
def ticks_on(axis_target: int | Axes, mode: Literal["x", "y", "xy"] = "xy") -> None:
|
|
137
137
|
"""
|
|
138
138
|
Turn on minor ticks for the specified axis.
|
|
139
139
|
|
|
@@ -141,7 +141,7 @@ def ticks_on(axis_target: int | Axes, mode=Literal["x", "y", "xy"]) -> None:
|
|
|
141
141
|
--------------------
|
|
142
142
|
axis_target : int | Axes
|
|
143
143
|
The target axis for minor tick configuration.
|
|
144
|
-
mode :
|
|
144
|
+
mode : {"x", "y", "xy"}, optional
|
|
145
145
|
Specifies the axis to configure. 'x' for x-axis, 'y' for y-axis,
|
|
146
146
|
and 'xy' for both axes. Default is 'xy'.
|
|
147
147
|
|
gsplot-0.0.1/gsplot/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|