Axes3D.view_init elevation issue between 270 and 360 degrees · Issue #10241 · matplotlib/matplotlib · GitHub
Skip to content

Axes3D.view_init elevation issue between 270 and 360 degrees #10241

Description

@amichaut

Bug report

Bug summary

I want to make rotate a 3D plot using the view_init method. If the azim argument is used it makes a smooth rotation around the z-axis. However, if the elev 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.

345
-15

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
from pylab import *

elevation=345 #or -15
angle=None

fig = 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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions