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!
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]:So I take that to mean setting
ontop
toTrue
would draw the gridlines over the data layer. But plotnine currently does this the other way around, where settingontop
toFalse
draws gridlines over the data layer. You can verify that common themes liketheme_gray
setsontop
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.