0
0
Matplotlibdata~10 mins

Viewing angle control in Matplotlib - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the elevation angle of the 3D plot to 30 degrees.

Matplotlib
ax.view_init(elev=[1], azim=45)
Drag options to blanks, or click blank then click option'
A45
B30
C60
D90
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing elevation with azimuth angle.
Using values outside the typical 0-90 degree range.
2fill in blank
medium

Complete the code to set the azimuth angle of the 3D plot to 120 degrees.

Matplotlib
ax.view_init(elev=20, azim=[1])
Drag options to blanks, or click blank then click option'
A45
B90
C120
D60
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up elevation and azimuth values.
Using negative values without understanding their effect.
3fill in blank
hard

Fix the error in the code to correctly set the viewing angle with elevation 45 and azimuth 135.

Matplotlib
ax.view_init(elev=45, azim=[1])
Drag options to blanks, or click blank then click option'
Aelev
B'135'
Cazim
D135
Attempts:
3 left
💡 Hint
Common Mistakes
Passing azimuth as a string instead of a number.
Using variable names instead of numeric values.
4fill in blank
hard

Fill both blanks to create a 3D plot with elevation 60 and azimuth 90.

Matplotlib
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.view_init(elev=[1], azim=[2])
plt.show()
Drag options to blanks, or click blank then click option'
A60
B45
C90
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping elevation and azimuth values.
Using incorrect numeric values.
5fill in blank
hard

Fill all three blanks to create a 3D scatter plot with elevation 25, azimuth 135, and set the marker style to 'o'.

Matplotlib
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.view_init(elev=[1], azim=[2])
ax.scatter(x, y, z, marker=[3])
plt.show()
Drag options to blanks, or click blank then click option'
A25
B135
C'o'
D'x'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes incorrectly for numeric values.
Choosing wrong marker styles.