Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit b3ef9b0

Browse files
Code review
1 parent ed883da commit b3ef9b0

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

‎doc/api/toolkits/mplot3d/view_angles.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ How to define the view angle
88
============================
99

1010
The position of the viewport "camera" in a 3D plot is defined by three angles:
11-
elevation, azimuth, and roll. From the resulting position, it always points
12-
towards the center of the plot box volume. The angle direction convention is
13-
shared with
11+
*elevation*, *azimuth*, and *roll*. From the resulting position, it always
12+
points towards the center of the plot box volume. The angle direction is a
13+
common convention, and is shared with
1414
`PyVista <https://docs.pyvista.org/api/core/camera.html>`_ and
1515
`MATLAB <https://www.mathworks.com/help/matlab/ref/view.html>`_
1616
(though MATLAB lacks a roll angle). Note that a positive roll angle rotates the

‎examples/mplot3d/view_planes_3d.py‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def annotate_axes(ax, text, fontsize=18):
1616
ax.text(x=0.5, y=0.5, z=0.5, s=text,
1717
va="center", ha="center", fontsize=fontsize, color="black")
1818

19-
# (view, (elev, azim, roll))
19+
# (plane, (elev, azim, roll))
2020
views = [('XY', (90, -90, 0)),
2121
('XZ', (0, -90, 0)),
2222
('YZ', (0, 0, 0)),
@@ -29,18 +29,15 @@ def annotate_axes(ax, text, fontsize=18):
2929
['.', '.', '-XY', '.']]
3030
fig, axd = plt.subplot_mosaic(layout, subplot_kw={'projection': '3d'},
3131
figsize=(12, 8.5))
32-
for i in range(len(axd) - 1):
33-
plane = views[i][0]
32+
for plane, angles in views:
3433
axd[plane].set_xlabel('x')
3534
axd[plane].set_ylabel('y')
3635
axd[plane].set_zlabel('z')
3736
axd[plane].set_proj_type('ortho')
38-
axd[plane].view_init(elev=views[i][1][0],
39-
azim=views[i][1][1],
40-
roll=views[i][1][2])
37+
axd[plane].view_init(elev=angles[0], azim=angles[1], roll=angles[2])
4138
axd[plane].set_box_aspect(None, zoom=1.25)
4239

43-
label = f'{plane}\n{views[i][1]}'
40+
label = f'{plane}\n{angles}'
4441
annotate_axes(axd[plane], label, fontsize=14)
4542

4643
for plane in ('XY', '-XY'):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /