Skip to content

Clarify that set_axisbelow doesn't move grids below images.#27497

Merged
timhoffm merged 1 commit intomatplotlib:mainfrom
anntzer:ab
Dec 12, 2023
Merged

Clarify that set_axisbelow doesn't move grids below images.#27497
timhoffm merged 1 commit intomatplotlib:mainfrom
anntzer:ab

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Dec 11, 2023

Even axisbelow(True) sets the grid zorder to 0.5, which is still over images (zorder 0). One may want to have grids below images if the image's extent doesn't cover the whole axes limits (e.g. the image only occupies the top left corner of the Axes and one wants to draw gridlines on the rest but keep them below the image otherwise).

(I got bitten by this today...)

PR summary

PR checklist

Even axisbelow(True) sets the grid zorder to 0.5, which is still over
images (zorder 0).  One may want to have grids *below* images if the
image's extent doesn't cover the whole axes limits (e.g. the image only
occupies the top left corner of the Axes and one wants to draw gridlines
on the rest but keep them below the image otherwise).
@timhoffm timhoffm added this to the v3.9.0 milestone Dec 12, 2023
@timhoffm timhoffm merged commit 6c953e8 into matplotlib:main Dec 12, 2023
@anntzer anntzer deleted the ab branch December 12, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants