Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Surprising behavior of shared axes with categorical units #18273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mwaskom opened this issue Aug 16, 2020 · 2 comments
Closed

Surprising behavior of shared axes with categorical units #18273

mwaskom opened this issue Aug 16, 2020 · 2 comments

Comments

@mwaskom
Copy link

mwaskom commented Aug 16, 2020

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
@aitikgupta
Copy link
Contributor

I think this has been resolved, since the issue is no longer reproducible on master branch.
Although, it is still reproducible for matplotlib==3.3.0

@QuLogic
Copy link
Member

QuLogic commented Nov 10, 2020

Yes, this was fixed by #18308.

@QuLogic QuLogic closed this as completed Nov 10, 2020
@QuLogic QuLogic added this to the v3.4.0 milestone Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants