Skip to content

panel_ontop has opposite meaning from ggplot2 - intentional? #585

Closed

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.

Activity

  1. has2k1 commented on Apr 30, 2022

    @has2k1
    Owner

    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!

  2. added a commit that references this issue on May 5, 2022
    cfc72a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions