Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.16.3] - 2026-01-07
- 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"

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridVisualize"
uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
authors = ["Juergen Fuhrmann <[email protected]>", "Patrick Jaap <[email protected]>"]
version = "1.16.2"
version = "1.16.3"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down
4 changes: 4 additions & 0 deletions ext/GridVisualizeMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)...,
)

Expand Down Expand Up @@ -619,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)...,
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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], ...)
```

Expand Down
6 changes: 6 additions & 0 deletions src/pycommon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -212,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])
Expand Down
Loading