Skip to content

ENH: Flip order of bar chart bars for multi-column data #58863

Open
@nateGeorge

Description

@nateGeorge

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Currently a horizontal bar chart correctly displays the legend, with the first column at the top and subsequent columns below. However, the order of the bars in the chart is flipped - the last entry in the legend is on top. This doesn't make sense and makes the charts confusing to read.
image

Feature Description

The order of bars in the chart should be the same as the legend - top to bottom and left to right from the columns.

Alternative Solutions

Could use matplotlib as a hack workaround. The easy solution is plt.gca().invert_yaxis() and seems like this should be in the pandas codebase for bar plots. https://stackoverflow.com/a/34094001/4549682

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions