maxplotlibx 0.1.5__tar.gz → 0.1.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.
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/PKG-INFO +1 -1
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/pyproject.toml +1 -1
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/canvas/canvas.py +18 -1
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_canvas.py +24 -1
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/PKG-INFO +1 -1
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/LICENSE +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/README.md +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/setup.cfg +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/matplotlib/utils.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotext/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotext/figure.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotly/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/backends/plotly/utils.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/canvas/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/colors/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/colors/colors.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/linestyle/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/linestyle/linestyle.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/node.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/objects/path.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/line_plot.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/subfigure/subfigure.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_flame_chart.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_gantt_chart.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_imports.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plot.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plotext.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/tests/test_plotly_backend.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/utils/__init__.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlib/utils/options.py +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/SOURCES.txt +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/dependency_links.txt +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/requires.txt +0 -0
- {maxplotlibx-0.1.5 → maxplotlibx-0.1.6}/src/maxplotlibx.egg-info/top_level.txt +0 -0
|
@@ -946,7 +946,24 @@ class Canvas:
|
|
|
946
946
|
layers: list | None = None,
|
|
947
947
|
usetex: bool | None = None,
|
|
948
948
|
verbose: bool = False,
|
|
949
|
+
block: bool = True,
|
|
949
950
|
):
|
|
951
|
+
"""
|
|
952
|
+
Render and display the canvas.
|
|
953
|
+
|
|
954
|
+
Parameters
|
|
955
|
+
----------
|
|
956
|
+
block : bool, optional
|
|
957
|
+
matplotlib backend only (default: True). Whether to block until
|
|
958
|
+
the figure window is closed before returning. Passed straight to
|
|
959
|
+
``plt.show(block=...)`` rather than left at its default, because
|
|
960
|
+
that default follows ``matplotlib.is_interactive()`` -- which
|
|
961
|
+
other imported code (IPython, a prior interactive session) can
|
|
962
|
+
flip to True behind this call's back, silently turning off
|
|
963
|
+
blocking. Forcing it explicitly is what makes repeated
|
|
964
|
+
``canvas.show()`` calls in a loop display one figure at a time
|
|
965
|
+
instead of every window appearing together.
|
|
966
|
+
"""
|
|
950
967
|
if verbose:
|
|
951
968
|
print(f"Showing canvas using backend: {backend}")
|
|
952
969
|
|
|
@@ -962,7 +979,7 @@ class Canvas:
|
|
|
962
979
|
)
|
|
963
980
|
if verbose:
|
|
964
981
|
print("Displaying Matplotlib figure...")
|
|
965
|
-
plt.show()
|
|
982
|
+
plt.show(block=block)
|
|
966
983
|
return fig, axes
|
|
967
984
|
elif backend == "plotly":
|
|
968
985
|
resolved_usetex = self._usetex if usetex is None else usetex
|
|
@@ -347,11 +347,34 @@ def test_canvas_show_uses_matplotlib_show(monkeypatch):
|
|
|
347
347
|
|
|
348
348
|
fig, axes = canvas.show()
|
|
349
349
|
|
|
350
|
-
|
|
350
|
+
# block=True is passed explicitly (not left at plt.show()'s own default)
|
|
351
|
+
# so a caller looping over several canvases shows them one at a time
|
|
352
|
+
# regardless of matplotlib's interactive-mode state.
|
|
353
|
+
assert calls == [((), {"block": True})]
|
|
351
354
|
assert fig is not None
|
|
352
355
|
assert axes is not None
|
|
353
356
|
|
|
354
357
|
|
|
358
|
+
def test_canvas_show_block_false_is_forwarded(monkeypatch):
|
|
359
|
+
import matplotlib.pyplot as plt
|
|
360
|
+
|
|
361
|
+
from maxplotlib import Canvas
|
|
362
|
+
|
|
363
|
+
calls = []
|
|
364
|
+
|
|
365
|
+
monkeypatch.setattr(
|
|
366
|
+
plt, "show", lambda *args, **kwargs: calls.append((args, kwargs))
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
canvas = Canvas()
|
|
370
|
+
subplot = canvas.add_subplot()
|
|
371
|
+
subplot.plot([0, 1], [0, 1])
|
|
372
|
+
|
|
373
|
+
canvas.show(block=False)
|
|
374
|
+
|
|
375
|
+
assert calls == [((), {"block": False})]
|
|
376
|
+
|
|
377
|
+
|
|
355
378
|
def test_show_canvas_script_invokes_canvas_show(monkeypatch):
|
|
356
379
|
import maxplotlib
|
|
357
380
|
|
|
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
|
|
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
|