0
0
Matplotlibdata~10 mins

3D wireframe plots 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 import the 3D plotting toolkit from matplotlib.

Matplotlib
from mpl_toolkits.mplot3d import [1]
Drag options to blanks, or click blank then click option'
Awireframe3d
Bplot3d
CAxes3D
Dplot_wireframe
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to import a function instead of the class.
Using a non-existent module name.
2fill in blank
medium

Complete the code to create a 3D subplot in matplotlib.

Matplotlib
fig = plt.figure()
ax = fig.add_subplot(111, projection='[1]')
Drag options to blanks, or click blank then click option'
A3d
B2d
C3D
Dwireframe
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase '3D' instead of lowercase '3d'.
Using '2d' projection which creates a 2D plot.
3fill in blank
hard

Fix the error in the code to plot a 3D wireframe using X, Y, Z data.

Matplotlib
ax.[1](X, Y, Z)
Drag options to blanks, or click blank then click option'
Aplot_wireframe
Bwireframe_plot
Cplot3d_wireframe
Dwireframe3d
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent method name.
Mixing method names from other plotting libraries.
4fill in blank
hard

Fill both blanks to create meshgrid arrays for X and Y from 1D arrays x and y.

Matplotlib
X, Y = np.[1](x, y, [2]='xy')
Drag options to blanks, or click blank then click option'
Ameshgrid
Blinspace
Cindexing
Darange
Attempts:
3 left
💡 Hint
Common Mistakes
Using linspace or arange instead of meshgrid.
Confusing parameter names.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps each word to its length if length is greater than 3.

Matplotlib
result = { [1]: [2] for [3] in words if len([3]) > 3 }
Drag options to blanks, or click blank then click option'
Aword
Blen(word)
Ditem
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Using the word itself as the value instead of its length.