Skip to content

categorical axis sorts its keys #9312

Closed
@anntzer

Description

@anntzer

Bug report

Bug summary

Categorical (i.e. string) xdata inputs get sorted before plotting.

Code for reproduction

plt.bar(["b", "a", "c"], [2, 1, 3])

Actual outcome

Bars appear in the order "a", "b", "c".

Expected outcome

Bars appear in the order of the input, so "b", "a", "c".

Matplotlib version

  • Operating system: Arch Linux
  • Matplotlib version: 2.1
  • Matplotlib backend (print(matplotlib.get_backend())): qt5agg
  • Python version: 3.6
  • Jupyter version (if applicable):
  • Other libraries:

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