add third angle to view_init() · Issue #14453 · matplotlib/matplotlib · GitHub
Skip to content

add third angle to view_init() #14453

Description

@baloe

Bug report

Bug summary

mpl_toolkits.mplot3d.axes3d.Axes3D.view_init
provides a means to set the elevation and the azimuth, but the z-axis is always aligned with the vertical camera axis.
A third angle would be required to permit any view.

The issue was reported on stackoverflow 3.5 years ago.

Code for reproduction

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

fig = plt.figure()
ax = Axes3D(fig)

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.show()

Actual outcome

Figure_1

Now, however hard you try to rotate the plot interactively or what angles you set in ax.view_init(), you will never be able to get the z-axis in a horizontalish position that is required to produce the plot below:

Expected outcome

By rotating interactively or via ax.view_init() one should be able to obtain this view below. Unfortunately, this is not possible.
Figure_2

Matplotlib version

  • Operating system: Ubuntu 16.04
  • Matplotlib version: 3.1.0, py37h5429711_0
  • Matplotlib backend: Qt5Agg
  • Python version: 3.7.3 (conda)

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