babelplot 2025.5__tar.gz → 2025.7__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.
- {babelplot-2025.5 → babelplot-2025.7}/PKG-INFO +1 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/__init__.py +2 -2
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/api/definition.py +1 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/api/help.py +1 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/catalog/bokeh_.py +10 -17
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/catalog/matplotlib_.py +107 -101
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/catalog/plotly_.py +241 -81
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/catalog/vedo_.py +7 -16
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/helper/validation.py +3 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/extension/enum_.py +3 -3
- babelplot-2025.7/package/babelplot/runtime/figure.py +55 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/task/help.py +4 -4
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/task/instantiation.py +9 -22
- babelplot-2025.5/package/babelplot/task/show_pyqt6.py → babelplot-2025.7/package/babelplot/task/showing.py +46 -11
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/type/backend.py +122 -16
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/type/dimension.py +24 -50
- babelplot-2025.5/package/babelplot/type/base.py → babelplot-2025.7/package/babelplot/type/ffp_base.py +13 -14
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/type/figure.py +60 -63
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/type/frame.py +12 -41
- babelplot-2025.7/package/babelplot/type/plot.py +61 -0
- babelplot-2025.5/package/babelplot/type/plot_definition.py → babelplot-2025.7/package/babelplot/type/plot_type.py +164 -251
- babelplot-2025.7/package/babelplot/type/translator.py +60 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/version.py +1 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot.egg-info/PKG-INFO +1 -1
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot.egg-info/SOURCES.txt +5 -3
- babelplot-2025.5/package/babelplot/type/plot.py +0 -126
- {babelplot-2025.5 → babelplot-2025.7}/MANIFEST.in +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/README-COPYRIGHT-utf8.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/README-LICENCE-utf8.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/README.rst +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/documentation/wiki/description.asciidoc +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/api/backend.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/backend/helper/creation.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/constant/backend.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/constant/path.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/constant/project.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/extension/function.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot/runtime/backends.py +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot.egg-info/dependency_links.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot.egg-info/requires.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/package/babelplot.egg-info/top_level.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/pyproject.toml +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/requirements.txt +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/setup.cfg +0 -0
- {babelplot-2025.5 → babelplot-2025.7}/setup.py +0 -0
|
@@ -18,9 +18,9 @@ else:
|
|
|
18
18
|
beartype_this_package()
|
|
19
19
|
|
|
20
20
|
from babelplot.task.instantiation import NewFigure, NewPlot
|
|
21
|
+
from babelplot.task.showing import ShowAllFigures
|
|
21
22
|
from babelplot.type.dimension import dim_e
|
|
22
|
-
from babelplot.type.
|
|
23
|
-
from babelplot.type.plot_definition import plot_e
|
|
23
|
+
from babelplot.type.plot_type import plot_e
|
|
24
24
|
from babelplot.version import __version__
|
|
25
25
|
|
|
26
26
|
"""
|
|
@@ -4,7 +4,7 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2022
|
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from babelplot.task.help import
|
|
7
|
+
from babelplot.task.help import PrintHelp # noqa
|
|
8
8
|
from babelplot.task.help import PrintUsage # noqa
|
|
9
9
|
|
|
10
10
|
"""
|
|
@@ -7,12 +7,12 @@ SEE COPYRIGHT NOTICE BELOW
|
|
|
7
7
|
import dataclasses as d
|
|
8
8
|
import typing as h
|
|
9
9
|
|
|
10
|
-
from babelplot.task.
|
|
10
|
+
from babelplot.task.showing import ShowHTMLWithPyQt
|
|
11
11
|
from babelplot.type.dimension import dim_e
|
|
12
12
|
from babelplot.type.figure import figure_t as base_figure_t
|
|
13
13
|
from babelplot.type.frame import frame_t as base_frame_t
|
|
14
14
|
from babelplot.type.plot import plot_t as base_plot_t
|
|
15
|
-
from babelplot.type.
|
|
15
|
+
from babelplot.type.plot_type import plot_e, plot_function_h
|
|
16
16
|
from bokeh.embed import file_html as HTMLofBackendContent # noqa
|
|
17
17
|
from bokeh.layouts import column as NewBackendColLayout # noqa
|
|
18
18
|
from bokeh.layouts import grid as NewBackendGridLayout # noqa
|
|
@@ -38,10 +38,7 @@ class frame_t(base_frame_t):
|
|
|
38
38
|
|
|
39
39
|
def _NewPlot(
|
|
40
40
|
self,
|
|
41
|
-
|
|
42
|
-
plot_function: (
|
|
43
|
-
type[backend_plot_t] | h.Callable[..., backend_plot_t | h.Any] | None
|
|
44
|
-
),
|
|
41
|
+
plot_function: plot_function_h,
|
|
45
42
|
*args,
|
|
46
43
|
title: str | None = None, # If _, then it is swallowed by kwargs!
|
|
47
44
|
**kwargs,
|
|
@@ -53,13 +50,6 @@ class frame_t(base_frame_t):
|
|
|
53
50
|
backend_name=self.backend_name,
|
|
54
51
|
)
|
|
55
52
|
|
|
56
|
-
if plot_function is None:
|
|
57
|
-
if hasattr(backend_frame_t, type_):
|
|
58
|
-
plot_function = getattr(backend_frame_t, type_)
|
|
59
|
-
else:
|
|
60
|
-
raise ValueError(f"{type_}: Unknown {NAME} graph object.")
|
|
61
|
-
|
|
62
|
-
output.backend_type = plot_function
|
|
63
53
|
output.raw = plot_function(self.raw, *args, **kwargs)
|
|
64
54
|
|
|
65
55
|
return output
|
|
@@ -69,8 +59,11 @@ class frame_t(base_frame_t):
|
|
|
69
59
|
class figure_t(base_figure_t):
|
|
70
60
|
layout: h.Any = None
|
|
71
61
|
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
_BackendShow = ShowHTMLWithPyQt
|
|
63
|
+
|
|
64
|
+
def _NewBackendFigure(self, *args, **kwargs) -> backend_figure_t:
|
|
65
|
+
""""""
|
|
66
|
+
return backend_figure_t(*args, **kwargs)
|
|
74
67
|
|
|
75
68
|
def _NewFrame(
|
|
76
69
|
self,
|
|
@@ -78,7 +71,7 @@ class figure_t(base_figure_t):
|
|
|
78
71
|
col: int,
|
|
79
72
|
*args,
|
|
80
73
|
title: str | None = None,
|
|
81
|
-
dim: dim_e = dim_e.XY,
|
|
74
|
+
dim: dim_e = dim_e.XY,
|
|
82
75
|
**kwargs,
|
|
83
76
|
) -> frame_t:
|
|
84
77
|
""""""
|
|
@@ -116,7 +109,7 @@ class figure_t(base_figure_t):
|
|
|
116
109
|
return HTMLofBackendContent(self.layout, INLINE)
|
|
117
110
|
|
|
118
111
|
|
|
119
|
-
PLOTS =
|
|
112
|
+
PLOTS = plot_e.NewPlotsTemplate()
|
|
120
113
|
PLOTS[plot_e.SCATTER][1] = backend_frame_t.scatter
|
|
121
114
|
|
|
122
115
|
|
|
@@ -10,12 +10,12 @@ import typing as h
|
|
|
10
10
|
import matplotlib.pyplot as pypl # noqa
|
|
11
11
|
import numpy as nmpy
|
|
12
12
|
import skimage.measure as msre
|
|
13
|
-
from babelplot.type.base import backend_element_h
|
|
14
13
|
from babelplot.type.dimension import dim_e
|
|
14
|
+
from babelplot.type.ffp_base import backend_element_h
|
|
15
15
|
from babelplot.type.figure import figure_t as base_figure_t
|
|
16
16
|
from babelplot.type.frame import frame_t as base_frame_t
|
|
17
17
|
from babelplot.type.plot import plot_t as base_plot_t
|
|
18
|
-
from babelplot.type.
|
|
18
|
+
from babelplot.type.plot_type import plot_e, plot_function_h, plot_type_h
|
|
19
19
|
from logger_36 import L
|
|
20
20
|
from matplotlib.artist import Artist as backend_plot_t # noqa
|
|
21
21
|
from matplotlib.container import Container as backend_plots_t # noqa
|
|
@@ -36,7 +36,7 @@ array_t = nmpy.ndarray
|
|
|
36
36
|
backend_frame_h = backend_frame_2d_t | backend_frame_3d_t
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def _DefaultProperties(type_:
|
|
39
|
+
def _DefaultProperties(type_: type[plot_type_h], /) -> dict[str, h.Any]:
|
|
40
40
|
""""""
|
|
41
41
|
name = type_.__name__
|
|
42
42
|
properties = mlpl.rcParams.find_all(f"^{name}\\.")
|
|
@@ -102,10 +102,7 @@ class frame_t(base_frame_t):
|
|
|
102
102
|
|
|
103
103
|
def _NewPlot(
|
|
104
104
|
self,
|
|
105
|
-
|
|
106
|
-
plot_function: (
|
|
107
|
-
type[backend_plot_t] | h.Callable[..., backend_plot_t | h.Any] | None
|
|
108
|
-
),
|
|
105
|
+
plot_function: plot_function_h,
|
|
109
106
|
*args,
|
|
110
107
|
title: str | None = None, # /!\ If _, then it is swallowed by kwargs!
|
|
111
108
|
**kwargs,
|
|
@@ -117,18 +114,6 @@ class frame_t(base_frame_t):
|
|
|
117
114
|
backend_name=self.backend_name,
|
|
118
115
|
)
|
|
119
116
|
|
|
120
|
-
if plot_function is None:
|
|
121
|
-
# Next, priority is given to 2-D plots... which might be a problem if a 2-D and
|
|
122
|
-
# 3-D frame have plot types with the same name. For example, scatter in 2-D and
|
|
123
|
-
# 3-D.
|
|
124
|
-
if hasattr(backend_frame_2d_t, type_):
|
|
125
|
-
plot_function = getattr(backend_frame_2d_t, type_)
|
|
126
|
-
elif hasattr(backend_frame_3d_t, type_):
|
|
127
|
-
plot_function = getattr(backend_frame_3d_t, type_)
|
|
128
|
-
else:
|
|
129
|
-
raise ValueError(f"{type_}: Unknown {NAME} graph object.")
|
|
130
|
-
|
|
131
|
-
output.backend_type = plot_function
|
|
132
117
|
output.raw = plot_function(self.raw, *args, **kwargs)
|
|
133
118
|
|
|
134
119
|
return output
|
|
@@ -139,10 +124,13 @@ class figure_t(base_figure_t):
|
|
|
139
124
|
_BackendSetProperty: h.ClassVar[h.Callable] = _SetProperty
|
|
140
125
|
_BackendProperty: h.ClassVar[h.Callable] = _Property
|
|
141
126
|
|
|
142
|
-
|
|
143
|
-
def _NewBackendFigure(*args, **kwargs) -> backend_figure_t:
|
|
127
|
+
def _NewBackendFigure(self, *args, **kwargs) -> backend_figure_t:
|
|
144
128
|
""""""
|
|
145
|
-
|
|
129
|
+
output = NewBackendFigure(*args, num=None, **kwargs)
|
|
130
|
+
|
|
131
|
+
output.canvas.mpl_connect("close_event", lambda *_, **__: _OnCloseEvent(self))
|
|
132
|
+
|
|
133
|
+
return output
|
|
146
134
|
|
|
147
135
|
def _NewFrame(
|
|
148
136
|
self,
|
|
@@ -169,9 +157,7 @@ class figure_t(base_figure_t):
|
|
|
169
157
|
)
|
|
170
158
|
self.raw.add_axes(raw)
|
|
171
159
|
else:
|
|
172
|
-
raise NotImplementedError(
|
|
173
|
-
f"{dim}: Dimension management not implemented yet"
|
|
174
|
-
)
|
|
160
|
+
raise NotImplementedError(f"Frame dimension {dim} not implemented.")
|
|
175
161
|
if title is not None:
|
|
176
162
|
raw.set_title(title)
|
|
177
163
|
|
|
@@ -181,22 +167,31 @@ class figure_t(base_figure_t):
|
|
|
181
167
|
|
|
182
168
|
def AdjustLayout(self) -> None:
|
|
183
169
|
""""""
|
|
184
|
-
|
|
170
|
+
figure_raw = self.raw
|
|
185
171
|
|
|
186
172
|
if self.title is not None:
|
|
187
|
-
|
|
173
|
+
figure_raw.suptitle(self.title)
|
|
188
174
|
for frame in self.frames:
|
|
189
175
|
if frame.title is not None:
|
|
190
176
|
frame.raw.set_title(frame.title)
|
|
191
177
|
for plot in frame.plots:
|
|
192
178
|
if plot.title is not None:
|
|
193
|
-
plot.raw
|
|
179
|
+
plot_raw = plot.raw
|
|
180
|
+
if isinstance(plot_raw, h.Sequence):
|
|
181
|
+
plot_raw_s = plot_raw
|
|
182
|
+
else:
|
|
183
|
+
plot_raw_s = (plot_raw,)
|
|
184
|
+
for plot_raw in plot_raw_s:
|
|
185
|
+
if (
|
|
186
|
+
SetLabel := getattr(plot_raw, "set_label", None)
|
|
187
|
+
) is not None:
|
|
188
|
+
SetLabel(plot.title)
|
|
194
189
|
|
|
195
190
|
if self.frames.__len__() < 2:
|
|
196
191
|
return
|
|
197
192
|
|
|
198
|
-
grid_spec = grid_spec_t(*self.shape, figure=
|
|
199
|
-
bottoms, tops, lefts, rights = grid_spec.get_grid_positions(
|
|
193
|
+
grid_spec = grid_spec_t(*self.shape, figure=figure_raw)
|
|
194
|
+
bottoms, tops, lefts, rights = grid_spec.get_grid_positions(figure_raw)
|
|
200
195
|
|
|
201
196
|
for frame, (row, col) in zip(self.frames, self.locations):
|
|
202
197
|
left, bottom, width, height = (
|
|
@@ -207,27 +202,27 @@ class figure_t(base_figure_t):
|
|
|
207
202
|
)
|
|
208
203
|
frame.raw.set_position((left, bottom, width, height))
|
|
209
204
|
|
|
210
|
-
def _BackendShow(self) -> None:
|
|
205
|
+
def _BackendShow(self, modal: bool, /) -> None:
|
|
211
206
|
""""""
|
|
212
207
|
raw = self.raw
|
|
213
|
-
|
|
214
208
|
raw.show()
|
|
215
209
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
210
|
+
if modal:
|
|
211
|
+
title = raw.get_suptitle()
|
|
212
|
+
if title.__len__() > 0:
|
|
213
|
+
title = f"{title} [MASTER FIGURE]"
|
|
214
|
+
else:
|
|
215
|
+
title = "MASTER FIGURE"
|
|
216
|
+
raw.suptitle(title)
|
|
221
217
|
|
|
218
|
+
raw.canvas.start_event_loop()
|
|
222
219
|
|
|
223
|
-
def _Polygon(
|
|
224
|
-
frame: backend_frame_2d_t, xs: array_t, ys: array_t, *_, **kwargs
|
|
225
|
-
) -> polygon_t:
|
|
226
|
-
""""""
|
|
227
|
-
output = polygon_t(nmpy.vstack((xs, ys)).T, **kwargs)
|
|
228
|
-
frame.add_patch(output)
|
|
229
220
|
|
|
230
|
-
|
|
221
|
+
def _OnCloseEvent(figure: figure_t, /) -> None:
|
|
222
|
+
""""""
|
|
223
|
+
# Hopefully, the event loop does not mind being stopped several times.
|
|
224
|
+
figure.raw.canvas.stop_event_loop()
|
|
225
|
+
figure.AcknowledgeClosure()
|
|
231
226
|
|
|
232
227
|
|
|
233
228
|
def _Arrows2(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plot_t:
|
|
@@ -276,6 +271,54 @@ def _Arrows3(frame: backend_frame_3d_t, *args, **kwargs) -> backend_plot_t:
|
|
|
276
271
|
return frame.quiver(x, y, z, u, v, w, **kwargs)
|
|
277
272
|
|
|
278
273
|
|
|
274
|
+
def _Bar3(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plot_t:
|
|
275
|
+
""""""
|
|
276
|
+
if args.__len__() == 1:
|
|
277
|
+
counts = nmpy.asarray(args[0])
|
|
278
|
+
x, y = counts.shape
|
|
279
|
+
else:
|
|
280
|
+
x, y, counts = args
|
|
281
|
+
counts = nmpy.asarray(counts)
|
|
282
|
+
if isinstance(x, int):
|
|
283
|
+
x, y = nmpy.meshgrid(range(x), range(y), indexing="ij")
|
|
284
|
+
if counts.ndim == 1:
|
|
285
|
+
x = x.ravel()
|
|
286
|
+
y = y.ravel()
|
|
287
|
+
|
|
288
|
+
width = kwargs.get("width", 0.8)
|
|
289
|
+
depth = kwargs.get("depth", 0.8)
|
|
290
|
+
offset = kwargs.get("offset", 0.0)
|
|
291
|
+
kwargs = {
|
|
292
|
+
_key: _vle
|
|
293
|
+
for _key, _vle in kwargs.items()
|
|
294
|
+
if _key not in ("width", "depth", "offset")
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return frame.bar3d(x, y, offset, width, depth, counts, **kwargs)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def _BarH(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plots_t:
|
|
301
|
+
""""""
|
|
302
|
+
if args.__len__() == 1:
|
|
303
|
+
counts = args[0]
|
|
304
|
+
positions = range(counts.__len__())
|
|
305
|
+
else:
|
|
306
|
+
positions, counts = args
|
|
307
|
+
|
|
308
|
+
return frame.barh(positions, counts, **kwargs)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def _BarV(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plots_t:
|
|
312
|
+
""""""
|
|
313
|
+
if args.__len__() == 1:
|
|
314
|
+
counts = args[0]
|
|
315
|
+
positions = range(counts.__len__())
|
|
316
|
+
else:
|
|
317
|
+
positions, counts = args
|
|
318
|
+
|
|
319
|
+
return frame.bar(positions, counts, **kwargs)
|
|
320
|
+
|
|
321
|
+
|
|
279
322
|
def _ElevationSurface(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plot_t:
|
|
280
323
|
""""""
|
|
281
324
|
if args.__len__() == 1:
|
|
@@ -327,52 +370,14 @@ def _Mesh(
|
|
|
327
370
|
)
|
|
328
371
|
|
|
329
372
|
|
|
330
|
-
def
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
counts = args[0]
|
|
334
|
-
positions = range(counts.__len__())
|
|
335
|
-
else:
|
|
336
|
-
positions, counts = args
|
|
337
|
-
|
|
338
|
-
return frame.barh(positions, counts, **kwargs)
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
def _BarV(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plots_t:
|
|
342
|
-
""""""
|
|
343
|
-
if args.__len__() == 1:
|
|
344
|
-
counts = args[0]
|
|
345
|
-
positions = range(counts.__len__())
|
|
346
|
-
else:
|
|
347
|
-
positions, counts = args
|
|
348
|
-
|
|
349
|
-
return frame.bar(positions, counts, **kwargs)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
def _Bar3(frame: backend_frame_2d_t, *args, **kwargs) -> backend_plot_t:
|
|
373
|
+
def _Polygon(
|
|
374
|
+
frame: backend_frame_2d_t, xs: array_t, ys: array_t, *_, **kwargs
|
|
375
|
+
) -> polygon_t:
|
|
353
376
|
""""""
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
x, y = counts.shape
|
|
357
|
-
else:
|
|
358
|
-
x, y, counts = args
|
|
359
|
-
counts = nmpy.asarray(counts)
|
|
360
|
-
if isinstance(x, int):
|
|
361
|
-
x, y = nmpy.meshgrid(range(x), range(y), indexing="ij")
|
|
362
|
-
if counts.ndim == 1:
|
|
363
|
-
x = x.ravel()
|
|
364
|
-
y = y.ravel()
|
|
365
|
-
|
|
366
|
-
width = kwargs.get("width", 0.8)
|
|
367
|
-
depth = kwargs.get("depth", 0.8)
|
|
368
|
-
offset = kwargs.get("offset", 0.0)
|
|
369
|
-
kwargs = {
|
|
370
|
-
_key: _vle
|
|
371
|
-
for _key, _vle in kwargs.items()
|
|
372
|
-
if _key not in ("width", "depth", "offset")
|
|
373
|
-
}
|
|
377
|
+
output = polygon_t(nmpy.vstack((xs, ys)).T, **kwargs)
|
|
378
|
+
frame.add_patch(output)
|
|
374
379
|
|
|
375
|
-
return
|
|
380
|
+
return output
|
|
376
381
|
|
|
377
382
|
|
|
378
383
|
def _Text2(frame: backend_frame_2d_t, text, x, y, *_, **kwargs) -> backend_plot_t:
|
|
@@ -385,26 +390,25 @@ def _Text3(frame: backend_frame_2d_t, text, x, y, z, *_, **kwargs) -> backend_pl
|
|
|
385
390
|
return frame.text(x, y, z, text, **kwargs)
|
|
386
391
|
|
|
387
392
|
|
|
388
|
-
PLOTS =
|
|
393
|
+
PLOTS = plot_e.NewPlotsTemplate()
|
|
389
394
|
|
|
390
|
-
PLOTS[plot_e.SCATTER][1] = backend_frame_2d_t.scatter
|
|
391
|
-
PLOTS[plot_e.POLYLINE][1] = backend_frame_2d_t.plot
|
|
392
|
-
PLOTS[plot_e.POLYGON][1] = _Polygon
|
|
393
395
|
PLOTS[plot_e.ARROWS][1] = _Arrows2
|
|
394
|
-
PLOTS[plot_e.
|
|
396
|
+
PLOTS[plot_e.ARROWS][2] = _Arrows3
|
|
397
|
+
PLOTS[plot_e.BAR3][2] = _Bar3
|
|
395
398
|
PLOTS[plot_e.BARH][1] = _BarH
|
|
396
399
|
PLOTS[plot_e.BARV][1] = _BarV
|
|
397
|
-
PLOTS[plot_e.PIE][1] = backend_frame_2d_t.pie
|
|
398
|
-
PLOTS[plot_e.IMAGE][1] = backend_frame_2d_t.matshow
|
|
399
|
-
PLOTS[plot_e.TEXT][1] = _Text2
|
|
400
|
-
|
|
401
|
-
PLOTS[plot_e.SCATTER][2] = backend_frame_3d_t.scatter
|
|
402
|
-
PLOTS[plot_e.POLYLINE][2] = backend_frame_3d_t.plot
|
|
403
|
-
PLOTS[plot_e.ARROWS][2] = _Arrows3
|
|
404
400
|
PLOTS[plot_e.ELEVATION][2] = _ElevationSurface
|
|
401
|
+
PLOTS[plot_e.IMAGE][1] = backend_frame_2d_t.matshow
|
|
402
|
+
PLOTS[plot_e.ISOSET][1] = _IsoContour
|
|
405
403
|
PLOTS[plot_e.ISOSET][2] = _IsoSurface
|
|
406
404
|
PLOTS[plot_e.MESH][2] = _Mesh
|
|
407
|
-
PLOTS[plot_e.
|
|
405
|
+
PLOTS[plot_e.PIE][1] = backend_frame_2d_t.pie
|
|
406
|
+
PLOTS[plot_e.POLYGON][1] = _Polygon
|
|
407
|
+
PLOTS[plot_e.POLYLINE][1] = backend_frame_2d_t.plot
|
|
408
|
+
PLOTS[plot_e.POLYLINE][2] = backend_frame_3d_t.plot
|
|
409
|
+
PLOTS[plot_e.SCATTER][1] = backend_frame_2d_t.scatter
|
|
410
|
+
PLOTS[plot_e.SCATTER][2] = backend_frame_3d_t.scatter
|
|
411
|
+
PLOTS[plot_e.TEXT][1] = _Text2
|
|
408
412
|
PLOTS[plot_e.TEXT][2] = _Text3
|
|
409
413
|
|
|
410
414
|
|
|
@@ -415,7 +419,9 @@ TRANSLATIONS = {
|
|
|
415
419
|
"color_max": "vmax",
|
|
416
420
|
"color_min": "vmin",
|
|
417
421
|
"color_scaling": "norm",
|
|
422
|
+
"colormap": "cmap",
|
|
418
423
|
"depth_shade": "depthshade",
|
|
424
|
+
"opacity": "alpha",
|
|
419
425
|
"plot_non_finite": "plotnonfinite",
|
|
420
426
|
"size": "s",
|
|
421
427
|
"width_edge": "linewidths",
|