Skip to content

Commit c0527dc

Browse files
committed
PyPlotter: use increasing figure numbers in initialize!
1 parent 9970b87 commit c0527dc

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [1.17.1] - 2026-03-25
4+
- `PyPlot/PythonPlot`: assign increasing `fignumber`s to each new context (user can see multiple plotting windows)
5+
36
## [1.17.0] - 2026-01-09
47
- Add `:symlog` axis scaling for symmetric logarithmic axis scaling, see, e.g. [matplotlib symlog](https://matplotlib.org/stable/gallery/scales/symlog_demo.html)
58
- Add `:symlog_threshold` (default = 10.0) to determine when to switch from linear to log scaling in case of `:symlog` scaling

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GridVisualize"
22
uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
33
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>", "Patrick Jaap <patrick.jaap@wias-berlin.de>"]
4-
version = "1.17.0"
4+
version = "1.17.1"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"

src/dispatch.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ function default_plot_kwargs()
337337
:dim => Pair(1, "Data dimension for PlutoVista plot"),
338338
:elev => Pair(30, "3D elevation angle (in degrees)"),
339339
:elevation => Pair(0.0, "2D plot height factor for elevation"),
340-
:fignumber => Pair(1, "Figure number (PyPlot)"),
340+
:fignumber => Pair(nothing, "Figure number (PyPlot)"),
341341
:fontsize => Pair(20, "Fontsize of titles. All others are relative to it"),
342342
:framepos => Pair(1, "Subplot position in frame (VTKView)"),
343343
:gridscale => Pair(1, "Grid scale factor. Will be applied also to planes, spacing"),

src/pycommon.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ function initialize!(p, ::Type{T}) where {T <: AbstractPythonPlotterType}
33
PyPlotter.rc("font"; size = p.context[:fontsize])
44
if !haskey(p.context, :figure)
55
res = p.context[:size]
6+
if isnothing(p.context[:fignumber])
7+
# assign next available figure number if nothing is defined
8+
p.context[:fignumber] = isempty(PyPlotter.get_fignums()) ? 1 : maximum(PyPlotter.get_fignums()) + 1
9+
end
610
if !isdefined(Main, :PlutoRunner)
711
p.context[:figure] = PyPlotter.figure(p.context[:fignumber]; dpi = 50, figsize = res ./ 50)
812
else

0 commit comments

Comments
 (0)