Skip to content

panel_ontop has opposite meaning from ggplot2 - intentional? #585

Closed
@JorySchossau

Description

@JorySchossau

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions