Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug report
Bug summary
I want to make rotate a 3D plot using theview_init
method. If theazim
argument is used it makes a smooth rotation around the z-axis. However, if theelev
argument is used the plot is flipped after the angle 270 degrees. This problem seems to come from the fact that the range [0:-90] does not give the same output as the range [270:360] while it should. Here are two outputs that should be the same for -15 and 345, but there are not.
Code for reproduction
importmatplotlib.pyplotaspltfrommatplotlibimportcmfrommpl_toolkits.mplot3dimportaxes3dfrompylabimport*elevation=345#or -15angle=Nonefig=plt.figure()ax=fig.add_subplot(111,projection='3d')X,Y,Z=axes3d.get_test_data(0.05)s=ax.plot_surface(X,Y,Z,cmap=cm.jet)ax.view_init(elev=elevation,azim=angle)plt.axis('off')
Matplotlib version
- Operating system: Debian
- Matplotlib version: 2.1
- Matplotlib backend:TkAgg
- Python version: 2.7
Installed from pip