You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
panel_ontop has opposite meaning from ggplot2 - intentional? #585
Hi,
I'm curious if ontop was intentionally made backwards from ggplot2's version? Instead of submitting a PR that was not asked for, I figured I should ask.
From ggplot2 docs [https://ggplot2.tidyverse.org/reference/theme.html]:
panel.ontop
option to place the panel (background, gridlines) over the data layers (logical).
Usually used with a transparent or blank panel.background.
So I take that to mean setting ontop to True would draw the gridlines over the data layer. But plotnine currently does this the other way around, where setting ontop to False draws gridlines over the data layer. You can verify that common themes like theme_gray sets ontop to True, which seems odd. It's so consistent across the code base that it seems intentional for some good reason, in which case don't mind me :) but I'd love to know the logic here for my own curiosity.
It is a bug. The default should be set to False so the underlying code (in themeables.py) should negate that. Yes, you can make a PR. The documentation is right!
Activity
has2k1 commentedon Apr 30, 2022
It is a bug. The default should be set to
Falseso the underlying code (inthemeables.py) should negate that. Yes, you can make a PR. The documentation is right!Fix panel_ontop themeable