Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Surprising behavior of shared axes with categorical units #18273

Copy link
Copy link
Closed
@mwaskom

Description

@mwaskom
Issue body actions

Bug report

Setting categorical units on an axis that is shared across subplots updates the units on its siblings, but not the order of the units.

Code for reproduction

f, axs = plt.subplots(1, 2, sharex=True)
axs[0].xaxis.update_units(["a", "c", "b"])
axs[1].plot(["a", "b", "c"], [1, 2, 3])

Actual outcome

image

Expected outcome

Compare to:

f, axs = plt.subplots(1, 2, sharex=True)
axs[0].xaxis.update_units(["a", "c", "b"])
axs[0].plot(["a", "b", "c"], [1, 2, 3])

image

Matplotlib version

  • Operating system:
  • Matplotlib version: 3.3.0
  • Matplotlib backend (print(matplotlib.get_backend())): pylab inline
  • Python version: 3.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.