Skip to content
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

[Bug]: Calling invert_yaxis() on a 3D plot inverts the xaxis #21843

Closed
baloe opened this issue Dec 2, 2021 · 1 comment
Closed

[Bug]: Calling invert_yaxis() on a 3D plot inverts the xaxis #21843

baloe opened this issue Dec 2, 2021 · 1 comment

Comments

@baloe
Copy link

baloe commented Dec 2, 2021

Bug summary

Instead of inverting the yaxis, invert_yaxis actually has the same effect as invert_xaxis:

The demo code is derived from the demo here.

Code for reproduction

import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(9,3.5), dpi=80)
ax1 = fig.add_subplot(141, projection='3d')
ax2 = fig.add_subplot(142, projection='3d')
ax3 = fig.add_subplot(143, projection='3d')
ax4 = fig.add_subplot(144, projection='3d')

fig.suptitle(f"matplotlib v{matplotlib.__version__}")

ax1.plot([1,1,10,10], [1,10,10,10], [1,1,1,10], marker="o")
ax2.plot([1,1,10,10], [1,10,10,10], [1,1,1,10], marker="o")
ax3.plot([1,1,10,10], [1,10,10,10], [1,1,1,10], marker="o")
ax4.plot([1,1,10,10], [1,10,10,10], [1,1,1,10], marker="o")

ax2.invert_xaxis()
ax3.invert_yaxis()
ax4.invert_zaxis()

plt.show()

Actual outcome

Figure_1

Expected outcome

Figure_edit
(well ... somewhat like this)

Additional information

This was worked on here, but apparently did not fix my issue, or am I missing something?
0e41317
#14579

Matplotlib Version

3.5.0

Installation

conda

@dstansby
Copy link
Member

dstansby commented Dec 2, 2021

Thanks for reporting with a clear example! I'm going to close this as a duplicate of #21369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants