Skip to content

categorical axis sorts its keys #9312

Closed

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:

Activity

  1. story645 commented on Feb 12, 2018

    @story645
    Member

    closed by #9783 though the jpl implementation of strconvertor has me thinking we should support sorted and unsorted by stashing the info in the plot kwarg arg and as an attribute on unitdata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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