Skip to content

Add colorbar for cell regions in 2D gridplot! with Py[thon]Plot#123

Merged
pjaap merged 3 commits intomainfrom
mo/fix/grid-colorbar
Apr 21, 2026
Merged

Add colorbar for cell regions in 2D gridplot! with Py[thon]Plot#123
pjaap merged 3 commits intomainfrom
mo/fix/grid-colorbar

Conversation

@mariekeosw
Copy link
Copy Markdown
Collaborator

I noticed that, in addition to the colorbar for boundary regions, a colorbar for cell regions was missing for 2D gridplots when using the PyPlot/ PythonPlot backend. This PR adds the missing colorbar within the gridplot! function.

Comment thread src/pycommon.jl Outdated
bcdata;
ax = ax,
ticks = collect(1:length(bcmap)),
orientation = "horizontal",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Nitpicking: sine we have a lot of duplicated code here:

Can you add something like if ctx[:colorbar] in [:vertical, :horizontal]
and then orientation = "$(ctx[:colorbar])"?

This should be more compact

Comment thread CHANGELOG.md Outdated
@@ -1,5 +1,8 @@
# Changelog

## [1.18.1] - 2026-04-21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add a CHANGELOG entry, then you have to bump the version too.

@mariekeosw
Copy link
Copy Markdown
Collaborator Author

For the sake of completeness, here is my example of a 2D grid plot with complete color bars:

image image

@pjaap pjaap merged commit 941ea1d into main Apr 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants