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

mplot3d: scatter (and others) incorrectly auto-scale axes after set_[xyz]lim() #783

Closed
zpincus opened this issue Mar 21, 2012 · 2 comments
Closed
Assignees

Comments

@zpincus
Copy link
Contributor

zpincus commented Mar 21, 2012

The 2d plot functions have some state variables so that if the axes have been manually re-scaled using the set_[xy]lim() functions (or wrappers around them), calling a plot function (like scatter) won't re-scale the axes.

This functionality appears to be missing / inactive in 3d plots:

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

ax = plt.axes(projection='3d')
ax.set_xlim(0,10)
ax.set_ylim(3,7)
ax.set_zlim(-5,15)
ax.scatter([4,5,6],[5,4,6],[6,5,4])
plt.show()

Note that the manually-set limits are no longer respected. Compare to the 2d case, where this works:

import matplotlib.pyplot as plt

ax = plt.axes()
ax.set_xlim(0,10)
ax.set_ylim(3,7)
ax.scatter([4,5,6],[5,4,6])
plt.show()
@ghost ghost assigned WeatherGod Mar 21, 2012
@WeatherGod
Copy link
Member

Actually, I think I know what is happening here and I might be able to fix this one later tonight.

@WeatherGod
Copy link
Member

This (and other things) are now fixed in PR #1289. It is doubtful it will make it in to the v1.2.0 release, but it will end up in the v1.2.x branch.

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

Successfully merging a pull request may close this issue.

2 participants