gsplot 0.2.0__tar.gz → 0.3.0__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.3.0/PKG-INFO +130 -0
- gsplot-0.3.0/README.md +107 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/__init__.py +23 -7
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/config/config.py +14 -12
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/axes.py +2 -2
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/axes_inset.py +1 -2
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/line.py +2 -2
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/line_colormap_dashed.py +6 -3
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/line_colormap_solid.py +4 -2
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/label.py +5 -2
- gsplot-0.3.0/gsplot/version.py +2 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/pyproject.toml +21 -10
- gsplot-0.2.0/PKG-INFO +0 -83
- gsplot-0.2.0/README.md +0 -62
- gsplot-0.2.0/gsplot/version.py +0 -2
- {gsplot-0.2.0 → gsplot-0.3.0}/LICENSE +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/base/base.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/base/base_alias_validator.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/color/colormap.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/data/load_file.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/axes_base.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/axes_range_base.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/figure_tools.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/show.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/figure/store.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/hello_world/hello_world.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/logger.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/path/path.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/line_base.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/line_colormap_base.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/scatter.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/plot/scatter_colormap.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/graph.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/legend.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/legend_colormap.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/ticks.py +0 -0
- {gsplot-0.2.0 → gsplot-0.3.0}/gsplot/style/title.py +0 -0
gsplot-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gsplot
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: General-scientific plot based on matplotlib
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: Giordano Mattoni
|
|
7
|
+
Author-email: mattoni@scphys.kyoto-u.ac.jp
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Requires-Dist: matplotlib (>=3.9.0)
|
|
16
|
+
Requires-Dist: numpy (>=1.26.4)
|
|
17
|
+
Requires-Dist: pyyaml (>=6.0.2)
|
|
18
|
+
Requires-Dist: rich (>=13.9.4)
|
|
19
|
+
Requires-Dist: types-pyyaml (>=6.0.12.20240917)
|
|
20
|
+
Project-URL: Homepage, https://soichiroyamane.github.io/gsplot/
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
<div align="center">
|
|
24
|
+
<img src="docs/_static/logo/logo_title_gsplot.png" alt="gsplot logo" width="300">
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
[](https://soichiroyamane.github.io/gsplot/stable/)
|
|
28
|
+
[](https://pypi.org/project/gsplot/)
|
|
29
|
+
[](https://www.python.org/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
|
|
32
|
+
# gsplot
|
|
33
|
+
|
|
34
|
+
`gsplot` is a small scientific-plotting toolkit built on Matplotlib. It adds
|
|
35
|
+
convenient figure layouts, consistent styling helpers, configurable defaults,
|
|
36
|
+
and lightweight version/configuration metadata while keeping ordinary
|
|
37
|
+
Matplotlib `Figure` and `Axes` objects in the workflow.
|
|
38
|
+
|
|
39
|
+
The package is still evolving. Check the [documentation](https://soichiroyamane.github.io/gsplot/stable/)
|
|
40
|
+
and the [issue tracker](https://github.com/SoichiroYamane/gsplot/issues) before
|
|
41
|
+
depending on behavior that is not covered by the public API.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
`gsplot` supports Python 3.10 and newer:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python -m pip install gsplot
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick example
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import gsplot as gs
|
|
55
|
+
|
|
56
|
+
axes = gs.axes(size=(8, 4), mosaic="AB", store=True)
|
|
57
|
+
gs.line(axes[0], [0, 1, 2], [0, 1, 4], label="quadratic")
|
|
58
|
+
gs.scatter(axes[1], [0, 1, 2], [0, 1, 4], label="samples")
|
|
59
|
+
gs.legend_axes()
|
|
60
|
+
gs.show("quickstart", show=False)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This creates a two-panel Matplotlib figure, saves `quickstart.png` when
|
|
64
|
+
storage is enabled, and remains compatible with regular Matplotlib operations:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
axes[0].set_title("A regular Matplotlib Axes")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For a complete scientific example, see the
|
|
71
|
+
[paper-plot demo](https://soichiroyamane.github.io/gsplot/stable/guides/demo/4_paper_plot.html).
|
|
72
|
+
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
Place a `gsplot.json` file in the working directory, or in
|
|
76
|
+
`~/.config/gsplot/gsplot.json`, to provide defaults for supported functions.
|
|
77
|
+
The first matching location is used. A path can also be loaded explicitly:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import gsplot as gs
|
|
81
|
+
|
|
82
|
+
gs.config_load("path/to/gsplot.json")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
When a value is specified more than once, the precedence is:
|
|
86
|
+
|
|
87
|
+
1. an argument passed directly to the function;
|
|
88
|
+
2. the corresponding function entry in `gsplot.json`;
|
|
89
|
+
3. the function's default value.
|
|
90
|
+
|
|
91
|
+
See the [configuration guide](https://soichiroyamane.github.io/gsplot/stable/guides/demo/3_config.html)
|
|
92
|
+
for the supported file layout and backend notes.
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
The repository uses Poetry and targets Python 3.10 or newer. With a compatible
|
|
97
|
+
Python interpreter:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
python -m pip install "poetry==2.4.1"
|
|
101
|
+
poetry install
|
|
102
|
+
MPLBACKEND=Agg poetry run pytest -q
|
|
103
|
+
MPLBACKEND=Agg poetry run sphinx-build -W -b html docs docs/_build/html
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The demos under `demo/` are executable documentation. Run one from its own
|
|
107
|
+
directory, for example:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cd demo/1_axes
|
|
111
|
+
python axes.py
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
See [the developer setup guide](docs/reference/contribution/developer_env.md)
|
|
115
|
+
for formatting, type checking, packaging, and Docker instructions.
|
|
116
|
+
|
|
117
|
+
For private vulnerability reports and the supported-version policy, see
|
|
118
|
+
[SECURITY.md](SECURITY.md).
|
|
119
|
+
|
|
120
|
+
## Authors
|
|
121
|
+
|
|
122
|
+
This repository was forked from code developed by Giordano Mattoni.
|
|
123
|
+
|
|
124
|
+
- Giordano Mattoni
|
|
125
|
+
- Soichiro Yamane
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
This project is distributed under the [MIT License](LICENSE).
|
|
130
|
+
|
gsplot-0.3.0/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="docs/_static/logo/logo_title_gsplot.png" alt="gsplot logo" width="300">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
[](https://soichiroyamane.github.io/gsplot/stable/)
|
|
6
|
+
[](https://pypi.org/project/gsplot/)
|
|
7
|
+
[](https://www.python.org/)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
# gsplot
|
|
11
|
+
|
|
12
|
+
`gsplot` is a small scientific-plotting toolkit built on Matplotlib. It adds
|
|
13
|
+
convenient figure layouts, consistent styling helpers, configurable defaults,
|
|
14
|
+
and lightweight version/configuration metadata while keeping ordinary
|
|
15
|
+
Matplotlib `Figure` and `Axes` objects in the workflow.
|
|
16
|
+
|
|
17
|
+
The package is still evolving. Check the [documentation](https://soichiroyamane.github.io/gsplot/stable/)
|
|
18
|
+
and the [issue tracker](https://github.com/SoichiroYamane/gsplot/issues) before
|
|
19
|
+
depending on behavior that is not covered by the public API.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
`gsplot` supports Python 3.10 and newer:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python -m pip install gsplot
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick example
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import gsplot as gs
|
|
33
|
+
|
|
34
|
+
axes = gs.axes(size=(8, 4), mosaic="AB", store=True)
|
|
35
|
+
gs.line(axes[0], [0, 1, 2], [0, 1, 4], label="quadratic")
|
|
36
|
+
gs.scatter(axes[1], [0, 1, 2], [0, 1, 4], label="samples")
|
|
37
|
+
gs.legend_axes()
|
|
38
|
+
gs.show("quickstart", show=False)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This creates a two-panel Matplotlib figure, saves `quickstart.png` when
|
|
42
|
+
storage is enabled, and remains compatible with regular Matplotlib operations:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
axes[0].set_title("A regular Matplotlib Axes")
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For a complete scientific example, see the
|
|
49
|
+
[paper-plot demo](https://soichiroyamane.github.io/gsplot/stable/guides/demo/4_paper_plot.html).
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
Place a `gsplot.json` file in the working directory, or in
|
|
54
|
+
`~/.config/gsplot/gsplot.json`, to provide defaults for supported functions.
|
|
55
|
+
The first matching location is used. A path can also be loaded explicitly:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import gsplot as gs
|
|
59
|
+
|
|
60
|
+
gs.config_load("path/to/gsplot.json")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
When a value is specified more than once, the precedence is:
|
|
64
|
+
|
|
65
|
+
1. an argument passed directly to the function;
|
|
66
|
+
2. the corresponding function entry in `gsplot.json`;
|
|
67
|
+
3. the function's default value.
|
|
68
|
+
|
|
69
|
+
See the [configuration guide](https://soichiroyamane.github.io/gsplot/stable/guides/demo/3_config.html)
|
|
70
|
+
for the supported file layout and backend notes.
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
The repository uses Poetry and targets Python 3.10 or newer. With a compatible
|
|
75
|
+
Python interpreter:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python -m pip install "poetry==2.4.1"
|
|
79
|
+
poetry install
|
|
80
|
+
MPLBACKEND=Agg poetry run pytest -q
|
|
81
|
+
MPLBACKEND=Agg poetry run sphinx-build -W -b html docs docs/_build/html
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The demos under `demo/` are executable documentation. Run one from its own
|
|
85
|
+
directory, for example:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd demo/1_axes
|
|
89
|
+
python axes.py
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See [the developer setup guide](docs/reference/contribution/developer_env.md)
|
|
93
|
+
for formatting, type checking, packaging, and Docker instructions.
|
|
94
|
+
|
|
95
|
+
For private vulnerability reports and the supported-version policy, see
|
|
96
|
+
[SECURITY.md](SECURITY.md).
|
|
97
|
+
|
|
98
|
+
## Authors
|
|
99
|
+
|
|
100
|
+
This repository was forked from code developed by Giordano Mattoni.
|
|
101
|
+
|
|
102
|
+
- Giordano Mattoni
|
|
103
|
+
- Soichiro Yamane
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
This project is distributed under the [MIT License](LICENSE).
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
from .color.colormap import get_cmap
|
|
2
|
-
from .config.config import (
|
|
3
|
-
|
|
2
|
+
from .config.config import (
|
|
3
|
+
Config,
|
|
4
|
+
config_dict,
|
|
5
|
+
config_entry_option,
|
|
6
|
+
config_load,
|
|
7
|
+
save_metadata,
|
|
8
|
+
)
|
|
4
9
|
from .data.load_file import load_file, load_file_fast
|
|
5
10
|
from .figure.axes import axes
|
|
6
11
|
from .figure.axes_inset import axes_inset, axes_inset_padding
|
|
@@ -14,12 +19,23 @@ from .plot.line_colormap_dashed import line_colormap_dashed
|
|
|
14
19
|
from .plot.line_colormap_solid import line_colormap_solid
|
|
15
20
|
from .plot.scatter import scatter
|
|
16
21
|
from .plot.scatter_colormap import scatter_colormap
|
|
17
|
-
from .style.graph import (
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
from .style.graph import (
|
|
23
|
+
graph_facecolor,
|
|
24
|
+
graph_square,
|
|
25
|
+
graph_square_axes,
|
|
26
|
+
graph_transparent,
|
|
27
|
+
graph_transparent_axes,
|
|
28
|
+
graph_white,
|
|
29
|
+
graph_white_axes,
|
|
30
|
+
)
|
|
20
31
|
from .style.label import label, label_add_index
|
|
21
|
-
from .style.legend import (
|
|
22
|
-
|
|
32
|
+
from .style.legend import (
|
|
33
|
+
legend,
|
|
34
|
+
legend_axes,
|
|
35
|
+
legend_get_handlers,
|
|
36
|
+
legend_handlers,
|
|
37
|
+
legend_reverse,
|
|
38
|
+
)
|
|
23
39
|
from .style.legend_colormap import legend_colormap
|
|
24
40
|
from .style.ticks import ticks_off, ticks_on, ticks_on_axes
|
|
25
41
|
from .style.title import title, title_axes
|
|
@@ -63,7 +63,7 @@ class Config:
|
|
|
63
63
|
Methods
|
|
64
64
|
--------------------
|
|
65
65
|
load(config_path=None)
|
|
66
|
-
Loads configuration data from a specified path or
|
|
66
|
+
Loads configuration data from a specified path or searches the default locations again.
|
|
67
67
|
get_config_entry_option(key)
|
|
68
68
|
Retrieves a specific entry from the configuration dictionary based on the provided key.
|
|
69
69
|
|
|
@@ -129,12 +129,12 @@ class Config:
|
|
|
129
129
|
|
|
130
130
|
def load(self, config_path: str | None = None) -> dict[str, Any]:
|
|
131
131
|
"""
|
|
132
|
-
Loads configuration data from a file or
|
|
132
|
+
Loads configuration data from a file or searches the default locations again.
|
|
133
133
|
|
|
134
134
|
Parameters
|
|
135
135
|
--------------------
|
|
136
136
|
config_path : str or None, optional
|
|
137
|
-
The path to the configuration file. If `None`,
|
|
137
|
+
The path to the configuration file. If `None`, searches the default locations again (default is None).
|
|
138
138
|
|
|
139
139
|
Returns
|
|
140
140
|
--------------------
|
|
@@ -149,9 +149,7 @@ class Config:
|
|
|
149
149
|
{'setting1': 'value1', 'setting2': 'value2'}
|
|
150
150
|
"""
|
|
151
151
|
loader: ConfigLoad = ConfigLoad(config_path)
|
|
152
|
-
config_dict: dict[str, Any] = (
|
|
153
|
-
loader.init_load() if config_path else loader.get_config()
|
|
154
|
-
)
|
|
152
|
+
config_dict: dict[str, Any] = loader.init_load()
|
|
155
153
|
self.config_dict = config_dict
|
|
156
154
|
|
|
157
155
|
# Save metadata
|
|
@@ -322,10 +320,14 @@ class ConfigLoad:
|
|
|
322
320
|
>>> rc_params = {"figure.dpi": 100, "backend": "TkAgg"}
|
|
323
321
|
>>> ConfigLoad.apply_rc_params(rc_params)
|
|
324
322
|
"""
|
|
325
|
-
|
|
323
|
+
params = dict(rc_params)
|
|
324
|
+
backend = params.pop("backend", None)
|
|
325
|
+
if backend is None:
|
|
326
|
+
# Keep accepting the historical plural spelling in existing files.
|
|
327
|
+
backend = params.pop("backends", None)
|
|
326
328
|
if backend:
|
|
327
|
-
mpl.use(backend)
|
|
328
|
-
rcParams.update(
|
|
329
|
+
mpl.use(str(backend))
|
|
330
|
+
rcParams.update(cast(Any, params))
|
|
329
331
|
|
|
330
332
|
def get_config(self) -> dict[str, Any]:
|
|
331
333
|
"""
|
|
@@ -346,13 +348,13 @@ class ConfigLoad:
|
|
|
346
348
|
"""
|
|
347
349
|
if not self.config_path:
|
|
348
350
|
return {}
|
|
349
|
-
with open(self.config_path, "r") as f:
|
|
351
|
+
with open(self.config_path, "r", encoding="utf-8") as f:
|
|
350
352
|
return cast(dict[str, Any], json.load(f))
|
|
351
353
|
|
|
352
354
|
|
|
353
355
|
def config_load(config_path: str | None = None) -> dict[str, Any]:
|
|
354
356
|
"""
|
|
355
|
-
Loads
|
|
357
|
+
Loads configuration data from a specified file or searches the default locations again.
|
|
356
358
|
|
|
357
359
|
This function initializes the `Config` singleton, loads the configuration file,
|
|
358
360
|
and returns the loaded configuration dictionary.
|
|
@@ -360,7 +362,7 @@ def config_load(config_path: str | None = None) -> dict[str, Any]:
|
|
|
360
362
|
Parameters
|
|
361
363
|
--------------------
|
|
362
364
|
config_path : str or None, optional
|
|
363
|
-
The path to the configuration file. If `None`, the
|
|
365
|
+
The path to the configuration file. If `None`, the default locations are searched again (default is None).
|
|
364
366
|
|
|
365
367
|
Returns
|
|
366
368
|
--------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections.abc import Hashable
|
|
2
2
|
from enum import Enum
|
|
3
|
-
from typing import Any, Generic, Literal, TypeVar
|
|
3
|
+
from typing import Any, Generic, Literal, TypeVar, cast
|
|
4
4
|
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
6
|
from matplotlib.axes import Axes
|
|
@@ -240,7 +240,7 @@ class AxesHandler(Generic[_T]):
|
|
|
240
240
|
list of matplotlib.axes.Axes
|
|
241
241
|
A list of axes in the current figure.
|
|
242
242
|
"""
|
|
243
|
-
return plt.gcf().axes
|
|
243
|
+
return cast(list[Axes], plt.gcf().axes)
|
|
244
244
|
|
|
245
245
|
def create_figure(self) -> None:
|
|
246
246
|
"""
|
|
@@ -3,8 +3,7 @@ from typing import Any, cast
|
|
|
3
3
|
from matplotlib.axes import Axes
|
|
4
4
|
from matplotlib.transforms import BboxBase, Transform, TransformedBbox
|
|
5
5
|
from matplotlib.typing import ColorType
|
|
6
|
-
from mpl_toolkits.axes_grid1.inset_locator import
|
|
7
|
-
inset_axes)
|
|
6
|
+
from mpl_toolkits.axes_grid1.inset_locator import BboxConnector, BboxPatch, inset_axes
|
|
8
7
|
|
|
9
8
|
from ..base.base import CreateClassParams, ParamsGetter, bind_passed_params
|
|
10
9
|
from ..style.label import Label
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import numbers
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any, cast
|
|
3
3
|
|
|
4
4
|
import matplotlib.pyplot as plt
|
|
5
5
|
import numpy as np
|
|
@@ -198,7 +198,7 @@ class Line:
|
|
|
198
198
|
*self.args,
|
|
199
199
|
**self.kwargs,
|
|
200
200
|
)
|
|
201
|
-
return _plot
|
|
201
|
+
return cast(list[Line2D], _plot)
|
|
202
202
|
|
|
203
203
|
|
|
204
204
|
@bind_passed_params()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
from typing import Any, cast
|
|
2
3
|
|
|
3
4
|
import matplotlib.pyplot as plt
|
|
4
5
|
import numpy as np
|
|
@@ -402,9 +403,10 @@ class LineColormapDashed:
|
|
|
402
403
|
self.x_interpolated[idx_start : i + 1],
|
|
403
404
|
self.y_interpolated[idx_start : i + 1],
|
|
404
405
|
)
|
|
406
|
+
collection_segments = cast(Sequence[ArrayLike], segments.tolist())
|
|
405
407
|
|
|
406
408
|
lc = LineCollection(
|
|
407
|
-
|
|
409
|
+
collection_segments,
|
|
408
410
|
cmap=self.cmap,
|
|
409
411
|
norm=norm,
|
|
410
412
|
capstyle="projecting",
|
|
@@ -431,9 +433,10 @@ class LineColormapDashed:
|
|
|
431
433
|
self.x_interpolated[idx_start:],
|
|
432
434
|
self.y_interpolated[idx_start:],
|
|
433
435
|
)
|
|
436
|
+
collection_segments = cast(Sequence[ArrayLike], segments.tolist())
|
|
434
437
|
|
|
435
438
|
lc = LineCollection(
|
|
436
|
-
|
|
439
|
+
collection_segments,
|
|
437
440
|
cmap=self.cmap,
|
|
438
441
|
norm=norm,
|
|
439
442
|
)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
from typing import Any, cast
|
|
2
3
|
|
|
3
4
|
import numpy as np
|
|
4
5
|
from matplotlib.axes import Axes
|
|
@@ -182,9 +183,10 @@ class LineColormapSolid:
|
|
|
182
183
|
self.x, self.y
|
|
183
184
|
)
|
|
184
185
|
norm = LineColormapBase()._create_cmap(self.cmapdata)
|
|
186
|
+
collection_segments = cast(Sequence[ArrayLike], segments.tolist())
|
|
185
187
|
|
|
186
188
|
lc: LineCollection = LineCollection(
|
|
187
|
-
|
|
189
|
+
collection_segments, cmap=self.cmap, norm=norm
|
|
188
190
|
)
|
|
189
191
|
lc.set_array(self.cmapdata)
|
|
190
192
|
lc.set_linewidth(self.linewidth)
|
|
@@ -15,8 +15,11 @@ from rich.panel import Panel
|
|
|
15
15
|
from rich.text import Text
|
|
16
16
|
|
|
17
17
|
from ..base.base import CreateClassParams, ParamsGetter, bind_passed_params
|
|
18
|
-
from ..figure.axes_range_base import (
|
|
19
|
-
|
|
18
|
+
from ..figure.axes_range_base import (
|
|
19
|
+
AxesRangeSingleton,
|
|
20
|
+
AxisRangeController,
|
|
21
|
+
AxisRangeManager,
|
|
22
|
+
)
|
|
20
23
|
from .ticks import MinorTicksAxes
|
|
21
24
|
|
|
22
25
|
__all__ = ["label", "label_add_index"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "gsplot"
|
|
3
3
|
|
|
4
|
-
version = "0.
|
|
4
|
+
version = "0.3.0"
|
|
5
5
|
|
|
6
6
|
description = "General-scientific plot based on matplotlib"
|
|
7
7
|
authors = [
|
|
@@ -24,21 +24,23 @@ types-pyyaml = ">=6.0.12.20240917"
|
|
|
24
24
|
|
|
25
25
|
[tool.poetry.group.dev.dependencies]
|
|
26
26
|
flake8 = "^7.0.0"
|
|
27
|
-
black = "
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
black = ">=26.3.1,<27.0.0"
|
|
28
|
+
isort = ">=5.13.2,<9.0.0"
|
|
29
|
+
pre-commit = "^4.6.1"
|
|
30
|
+
furo = "^2025.12.19"
|
|
30
31
|
myst-parser = "^4.0.0"
|
|
31
32
|
pytest-watch = "^4.2.0"
|
|
32
|
-
pytest = "
|
|
33
|
+
pytest = ">=9.0.3,<10.0.0"
|
|
33
34
|
pyright = "^1.1.390"
|
|
34
|
-
mypy = "^
|
|
35
|
-
|
|
35
|
+
mypy = "^2.3.0"
|
|
36
|
+
pip-audit = { version = ">=2.10.1,<3.0.0", python = ">=3.10,<4.0" }
|
|
37
|
+
sphinxext-opengraph = "^0.13.0"
|
|
36
38
|
sphinx-pyscript = "^0.1.0"
|
|
37
39
|
sphinx-tippy = "^0.4.3"
|
|
38
|
-
sphinx-togglebutton = "^0.
|
|
40
|
+
sphinx-togglebutton = "^0.4.5"
|
|
39
41
|
sphinx-design = "^0.6.1"
|
|
40
|
-
sphinxcontrib-mermaid = "^1.0
|
|
41
|
-
pydata-sphinx-theme = "^0.
|
|
42
|
+
sphinxcontrib-mermaid = "^2.1.0"
|
|
43
|
+
pydata-sphinx-theme = "^0.19.0"
|
|
42
44
|
sphinx-copybutton = "^0.5.2"
|
|
43
45
|
sphinx-autobuild = "^2024.10.3"
|
|
44
46
|
sphinx-multiversion = "^0.2.4"
|
|
@@ -47,3 +49,12 @@ sphinx-multiversion = "^0.2.4"
|
|
|
47
49
|
[build-system]
|
|
48
50
|
requires = ["poetry-core"]
|
|
49
51
|
build-backend = "poetry.core.masonry.api"
|
|
52
|
+
|
|
53
|
+
[tool.black]
|
|
54
|
+
extend-exclude = "gsplot/version.py"
|
|
55
|
+
|
|
56
|
+
[tool.isort]
|
|
57
|
+
profile = "black"
|
|
58
|
+
|
|
59
|
+
[tool.pytest.ini_options]
|
|
60
|
+
testpaths = ["tests"]
|
gsplot-0.2.0/PKG-INFO
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: gsplot
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: General-scientific plot based on matplotlib
|
|
5
|
-
Author: Giordano Mattoni
|
|
6
|
-
Author-email: mattoni@scphys.kyoto-u.ac.jp
|
|
7
|
-
Requires-Python: >=3.10
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
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
|
|
13
|
-
Requires-Dist: matplotlib (>=3.9.0)
|
|
14
|
-
Requires-Dist: numpy (>=1.26.4)
|
|
15
|
-
Requires-Dist: pyyaml (>=6.0.2)
|
|
16
|
-
Requires-Dist: rich (>=13.9.4)
|
|
17
|
-
Requires-Dist: types-pyyaml (>=6.0.12.20240917)
|
|
18
|
-
Project-URL: Homepage, https://soichiroyamane.github.io/gsplot/
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
|
|
21
|
-
<div align="center">
|
|
22
|
-
<img src="docs/_static/logo/logo_title_gsplot.png" alt="logo_gsplot" width="300">
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
[](https://github.com/SoichiroYamane/gsplot/actions/workflows/gh-pages-sphinx.yml)
|
|
26
|
-

|
|
27
|
-

|
|
28
|
-

|
|
29
|
-
[](https://pepy.tech/projects/gsplot)
|
|
30
|
-

|
|
31
|
-

|
|
32
|
-
|
|
33
|
-
----------------
|
|
34
|
-
|
|
35
|
-
<p align="center" style="font-weight: bold; font-size: 1.2em; margin: 20px 0;">
|
|
36
|
-
<a href="https://soichiroyamane.github.io/gsplot/stable" style="text-decoration: none;">Docs</a> |
|
|
37
|
-
<a href="#authors" style="text-decoration: none;">Authors</a> |
|
|
38
|
-
<a href="#license" style="text-decoration: none;">License</a>
|
|
39
|
-
</p>
|
|
40
|
-
|
|
41
|
-
Welcome to **gsplot** (General-Scientific Plot), a toolkit designed to elevate capabilities of data visualization based on [matplotlib](https://matplotlib.org). This package is specifically tailored for creating high-quality figures aimed at the scientific field.
|
|
42
|
-
|
|
43
|
-
> [!WARNING]
|
|
44
|
-
> This package is _beta_ quality. Expect breaking changes and many bugs 🐛. Please report any issue you encounter 🤝.
|
|
45
|
-
|
|
46
|
-
## ✨ Features
|
|
47
|
-
|
|
48
|
-
- **Better Plot, Less Effort**: Effortlessly create high-quality figures ⚛️
|
|
49
|
-
- **Compatibility**: Fully compatible with [matplotlib](https://matplotlib.org) 📊
|
|
50
|
-
- **Customization**: Tailor configurations to suit your needs 🎨
|
|
51
|
-
- **Reproducibility**: Save package states for reproducible plots 📦
|
|
52
|
-
|
|
53
|
-
### 📈 Example using gsplot
|
|
54
|
-
|
|
55
|
-
[See more details](https://soichiroyamane.github.io/gsplot/stable/guides/demo/4_paper_plot.html)
|
|
56
|
-
|
|
57
|
-

|
|
58
|
-
|
|
59
|
-
### 🌃 Example with Python REPL 🐍 and neovim 🌟
|
|
60
|
-
|
|
61
|
-
[See more details](https://soichiroyamane.github.io/gsplot/stable/guides/demo/13_REPL.html)
|
|
62
|
-
|
|
63
|
-

|
|
64
|
-
|
|
65
|
-
## 🚀 Getting Started
|
|
66
|
-
|
|
67
|
-
To use **gsplot**, ensure that you have `Python 3.10+` installed. You can install the package using `pip`:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pip install gsplot
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## 👥 Authors
|
|
74
|
-
|
|
75
|
-
This repository was forked from codes developed by Giordano Mattoni.
|
|
76
|
-
|
|
77
|
-
- Giordano Mattoni
|
|
78
|
-
- Soichiro Yamane
|
|
79
|
-
|
|
80
|
-
## 📜 License
|
|
81
|
-
|
|
82
|
-
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
|
|
83
|
-
|
gsplot-0.2.0/README.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="docs/_static/logo/logo_title_gsplot.png" alt="logo_gsplot" width="300">
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
[](https://github.com/SoichiroYamane/gsplot/actions/workflows/gh-pages-sphinx.yml)
|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
[](https://pepy.tech/projects/gsplot)
|
|
10
|
-

|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
----------------
|
|
14
|
-
|
|
15
|
-
<p align="center" style="font-weight: bold; font-size: 1.2em; margin: 20px 0;">
|
|
16
|
-
<a href="https://soichiroyamane.github.io/gsplot/stable" style="text-decoration: none;">Docs</a> |
|
|
17
|
-
<a href="#authors" style="text-decoration: none;">Authors</a> |
|
|
18
|
-
<a href="#license" style="text-decoration: none;">License</a>
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
Welcome to **gsplot** (General-Scientific Plot), a toolkit designed to elevate capabilities of data visualization based on [matplotlib](https://matplotlib.org). This package is specifically tailored for creating high-quality figures aimed at the scientific field.
|
|
22
|
-
|
|
23
|
-
> [!WARNING]
|
|
24
|
-
> This package is _beta_ quality. Expect breaking changes and many bugs 🐛. Please report any issue you encounter 🤝.
|
|
25
|
-
|
|
26
|
-
## ✨ Features
|
|
27
|
-
|
|
28
|
-
- **Better Plot, Less Effort**: Effortlessly create high-quality figures ⚛️
|
|
29
|
-
- **Compatibility**: Fully compatible with [matplotlib](https://matplotlib.org) 📊
|
|
30
|
-
- **Customization**: Tailor configurations to suit your needs 🎨
|
|
31
|
-
- **Reproducibility**: Save package states for reproducible plots 📦
|
|
32
|
-
|
|
33
|
-
### 📈 Example using gsplot
|
|
34
|
-
|
|
35
|
-
[See more details](https://soichiroyamane.github.io/gsplot/stable/guides/demo/4_paper_plot.html)
|
|
36
|
-
|
|
37
|
-

|
|
38
|
-
|
|
39
|
-
### 🌃 Example with Python REPL 🐍 and neovim 🌟
|
|
40
|
-
|
|
41
|
-
[See more details](https://soichiroyamane.github.io/gsplot/stable/guides/demo/13_REPL.html)
|
|
42
|
-
|
|
43
|
-

|
|
44
|
-
|
|
45
|
-
## 🚀 Getting Started
|
|
46
|
-
|
|
47
|
-
To use **gsplot**, ensure that you have `Python 3.10+` installed. You can install the package using `pip`:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
pip install gsplot
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 👥 Authors
|
|
54
|
-
|
|
55
|
-
This repository was forked from codes developed by Giordano Mattoni.
|
|
56
|
-
|
|
57
|
-
- Giordano Mattoni
|
|
58
|
-
- Soichiro Yamane
|
|
59
|
-
|
|
60
|
-
## 📜 License
|
|
61
|
-
|
|
62
|
-
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
|
gsplot-0.2.0/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
|