From db2f8a3f32870a0a8ca8f4a27d24359046cb1f21 Mon Sep 17 00:00:00 2001 From: Marieke Osewold Date: Tue, 6 Jan 2026 10:54:37 +0100 Subject: [PATCH 1/4] add xlabel, title to 1D gridplots --- CHANGELOG.md | 4 ++++ Project.toml | 2 +- ext/GridVisualizeMakieExt.jl | 2 ++ src/pycommon.jl | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ef11a..4a4c974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.16.3] - 2026-01-06 +- Add `xlabel` to 1D `gridplot!` with `GLMakie` +- Add `title` and `xlabel` to 1D `gridplot!` with `Py[thon]Plot` + ## [1.16.2] - 2025-12-04 - `leglocs[:cc]`: correct "center center" to "center" diff --git a/Project.toml b/Project.toml index 213e64d..fc72edc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridVisualize" uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8" authors = ["Juergen Fuhrmann ", "Patrick Jaap "] -version = "1.16.2" +version = "1.16.3" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/ext/GridVisualizeMakieExt.jl b/ext/GridVisualizeMakieExt.jl index 9ff52a7..31bfd66 100644 --- a/ext/GridVisualizeMakieExt.jl +++ b/ext/GridVisualizeMakieExt.jl @@ -275,6 +275,7 @@ function scenecorners1d(grid, gridscale) return [Point2f(xmin * gridscale, -5 * h), Point2f(xmax * gridscale, 5 * h)] end +# 1D version function gridplot!(ctx, TP::Type{MakieType}, ::Type{Val{1}}, grid) XMakie = ctx[:Plotter] nregions = num_cellregions(grid) @@ -286,6 +287,7 @@ function gridplot!(ctx, TP::Type{MakieType}, ::Type{Val{1}}, grid) yticklabelsvisible = false, yticksvisible = false, title = ctx[:title], + xlabel = ctx[:xlabel], scenekwargs(ctx)..., ) diff --git a/src/pycommon.jl b/src/pycommon.jl index 2f72658..9e54f73 100644 --- a/src/pycommon.jl +++ b/src/pycommon.jl @@ -149,6 +149,9 @@ function gridplot!(ctx, TP::Type{T}, ::Type{Val{1}}, grid) where {T <: AbstractP ax.grid(true) ax.get_yaxis().set_ticks(Float64[]) ax.set_ylim(-5 * h, xmax - xmin) + ax.set_title(ctx[:title]) + ax.set_xlabel(ctx[:xlabel]) + cmap = region_cmap(max(ncellregions, 5)) gridscale = ctx[:gridscale] From 4681a2ee0526c1e263f53bf556ddeb01e3fb0e05 Mon Sep 17 00:00:00 2001 From: Marieke Osewold Date: Tue, 6 Jan 2026 18:05:56 +0100 Subject: [PATCH 2/4] add title, xlabel, ylabel to 2D gridplots --- CHANGELOG.md | 4 ++++ Project.toml | 2 +- ext/GridVisualizeMakieExt.jl | 2 ++ src/dispatch.jl | 2 +- src/pycommon.jl | 3 +++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a4c974..fc8a9c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.16.4] - 2026-01-06 +- Add `xlabel` and `ylabel` to 2D `gridplot!` with `GLMakie` +- Add `title`, `xlabel` and `ylabel` to 2D `gridplot!` with `Py[thon]Plot` + ## [1.16.3] - 2026-01-06 - Add `xlabel` to 1D `gridplot!` with `GLMakie` - Add `title` and `xlabel` to 1D `gridplot!` with `Py[thon]Plot` diff --git a/Project.toml b/Project.toml index fc72edc..744ed57 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridVisualize" uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8" authors = ["Juergen Fuhrmann ", "Patrick Jaap "] -version = "1.16.3" +version = "1.16.4" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/ext/GridVisualizeMakieExt.jl b/ext/GridVisualizeMakieExt.jl index 31bfd66..1a5ac2f 100644 --- a/ext/GridVisualizeMakieExt.jl +++ b/ext/GridVisualizeMakieExt.jl @@ -621,6 +621,8 @@ function gridplot!(ctx, TP::Type{MakieType}, ::Type{Val{2}}, grid) ctx[:scene] = XMakie.Axis( ctx[:figure]; title = ctx[:title], + xlabel = ctx[:xlabel], + ylabel = ctx[:ylabel], aspect = aspect, autolimitaspect = autolimitaspect, scenekwargs(ctx)..., diff --git a/src/dispatch.jl b/src/dispatch.jl index 2d50129..dd54279 100644 --- a/src/dispatch.jl +++ b/src/dispatch.jl @@ -221,7 +221,7 @@ Depending on the `layout` keyword argument, a 2D grid of subplots is created. Further `...plot!` commands then plot into one of these subplots: ```julia -vis=GridVisualizer(Plotter=PyPlot, layout=(2,2) +vis=GridVisualizer(Plotter=PyPlot, layout=(2,2)) ...plot!(vis[1,2], ...) ``` diff --git a/src/pycommon.jl b/src/pycommon.jl index 9e54f73..8155754 100644 --- a/src/pycommon.jl +++ b/src/pycommon.jl @@ -215,6 +215,9 @@ function gridplot!(ctx, TP::Type{T}, ::Type{Val{2}}, grid) where {T <: AbstractP end end ax = ctx[:ax] + ax.set_title(ctx[:title]) + ax.set_xlabel(ctx[:xlabel]) + ax.set_ylabel(ctx[:ylabel]) fig = ctx[:figure] cellregions = cellcolors(grid, ctx[:cellcoloring]) ncellregions = num_cellcolors(grid, ctx[:cellcoloring]) From 07e7a016aaa578cf6bd657baef6c9305be26dac8 Mon Sep 17 00:00:00 2001 From: Marieke Osewold Date: Wed, 7 Jan 2026 10:05:47 +0100 Subject: [PATCH 3/4] remove duplicate version numbers --- CHANGELOG.md | 8 +++----- Project.toml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc8a9c1..ac170b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,10 @@ # Changelog -## [1.16.4] - 2026-01-06 -- Add `xlabel` and `ylabel` to 2D `gridplot!` with `GLMakie` -- Add `title`, `xlabel` and `ylabel` to 2D `gridplot!` with `Py[thon]Plot` - -## [1.16.3] - 2026-01-06 +## [1.16.3] - 2026-01-07 - Add `xlabel` to 1D `gridplot!` with `GLMakie` - Add `title` and `xlabel` to 1D `gridplot!` with `Py[thon]Plot` +- Add `xlabel` and `ylabel` to 2D `gridplot!` with `GLMakie` +- Add `title`, `xlabel` and `ylabel` to 2D `gridplot!` with `Py[thon]Plot` ## [1.16.2] - 2025-12-04 - `leglocs[:cc]`: correct "center center" to "center" diff --git a/Project.toml b/Project.toml index 744ed57..fc72edc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridVisualize" uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8" authors = ["Juergen Fuhrmann ", "Patrick Jaap "] -version = "1.16.4" +version = "1.16.3" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" From ecfea0a3d67962c71dc9be07122f6ea31b0b3f79 Mon Sep 17 00:00:00 2001 From: Marieke Osewold Date: Wed, 7 Jan 2026 10:35:05 +0100 Subject: [PATCH 4/4] simplify changelog entry --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac170b8..9ee5bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,8 @@ # Changelog ## [1.16.3] - 2026-01-07 -- Add `xlabel` to 1D `gridplot!` with `GLMakie` -- Add `title` and `xlabel` to 1D `gridplot!` with `Py[thon]Plot` -- Add `xlabel` and `ylabel` to 2D `gridplot!` with `GLMakie` -- Add `title`, `xlabel` and `ylabel` to 2D `gridplot!` with `Py[thon]Plot` +- Add `title`, `xlabel`, and `ylabel` to 1D and 2D `gridplot!` with `GLMakie` +- Add `title`, `xlabel`, and `ylabel` to 1D and 2D `gridplot!` with `Py[thon]Plot` ## [1.16.2] - 2025-12-04 - `leglocs[:cc]`: correct "center center" to "center"