Skip to content

boxplot/violinplot orientation-setting API #13435

Description

@anntzer

Bug report

Bug summary

Currently, boxplot(), bxp(), violin(), and violinplot() take a vert: bool argument to switch between vertical and horizontal; this is inconsistent with colorbar(), hist(), eventplot(), and Slider(), which take an orientation: {"vertical", "horizontal"} argument.

For consistency, I'd suggest adding support for orientation (both because I think colorbar() and hist(), in particular, are probably the most used among all these, and because I like the API better :-)), and later deprecate vert. Thoughts?

attn @phobson who has been involved in boxplots, IIRC.

Activity

  1. added
    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …
    on Feb 14, 2019
  2. phobson commented on Feb 14, 2019

    @phobson
    Member

    I think this is a good idea.

    Should be easy enough to capture vert, emit and deprecation warning, and then set orientation accordingly.

  3. anntzer commented on Feb 14, 2019

    @anntzer
    ContributorAuthor

    (and while we're at it, the manage_xticks arg should be renamed to manage_ticks, as it covers both orientations)

  4. phobson commented on Feb 14, 2019

    @phobson
    Member

    just throwing this out there: what would you say to manage_labels?

  5. anntzer commented on Feb 14, 2019

    @anntzer
    ContributorAuthor

    well technically it's managing ticks, tick labels, and axis limits so I think manage_labels is worse than manage_ticks, and perhaps manage_axis is better?
    I also wonder whether it really needs to manage axis limits -- can't the standard margins system do that just as well? (needs to be investigated)

  6. phobson commented on Feb 14, 2019

    @phobson
    Member

    good points all around.

    just noticed a wrinkle: boxplot.vert is an rcParam

  7. anntzer commented on Feb 14, 2019

    @anntzer
    ContributorAuthor

    We know how to handle deprecation/renaming of rcParams too, but thanks for pointing that out.

  8. github-actions commented on May 31, 2023

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  9. added
    keepItems to be ignored by the “Stale” Github Action
    and removed
    status: inactiveMarked by the “Stale” Github Action
    on May 31, 2023
  10. anntzer commented on May 31, 2023

    @anntzer
    ContributorAuthor

    At least adding orientation should hopefully be uncontroversial.

  11. added this to the future releases milestone on Jun 1, 2023
  12. saranti commented on Mar 30, 2024

    @saranti
    Contributor

    Would you want separate PRs for boxplot and violinplot to keep it simple? The review process for the boxplot section will probably take a bit longer because it involves the deprecation of an rcParam which Ive never done before.

  13. timhoffm commented on Mar 30, 2024

    @timhoffm
    Member

    Should we simply deprecate the boxplot.vert rcParams without replacement? This is more of a plot-type setting rather than style. It’s not useful as a global config or style parameter. The only use case would be a local context (e.g. via a context manager) if somebody wants to make multiple horizontal plots. But for that rare case using the parameter explicitly may be good enough and is more clear for the reader.

    I believe, we also don’t have that config for bar() or hist().

  14. phobson commented on Apr 3, 2024

    @phobson
    Member

    Should we simply deprecate the boxplot.vert rcParams without replacement? [snip] I believe, we also don’t have that config for bar() or hist()

    I think that's a good idea and the justification is solid, IMO

  15. removed
    keepItems to be ignored by the “Stale” Github Action
    on May 15, 2024
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

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions