Recall & Review
beginner
What is a 3D surface plot?
A 3D surface plot is a graph that shows a three-dimensional surface. It helps us see how two variables affect a third variable by drawing a surface in 3D space.
Click to reveal answer
beginner
Which matplotlib module is used to create 3D surface plots?
The
mpl_toolkits.mplot3d module is used to create 3D plots, including surface plots, in matplotlib.Click to reveal answer
beginner
What function in matplotlib creates a 3D surface plot?
The
plot_surface() function of a 3D axis object creates a 3D surface plot.Click to reveal answer
intermediate
How do you prepare data for a 3D surface plot?
You create two 2D arrays for the X and Y coordinates using
numpy.meshgrid(). Then calculate the Z values for each (X, Y) pair.Click to reveal answer
intermediate
How can you change the color of a 3D surface plot?
You can use the
cmap parameter in plot_surface() to set a color map, like cmap='viridis' or cmap='coolwarm'.Click to reveal answer
Which function creates a grid of X and Y values for 3D surface plots?
✗ Incorrect
numpy.meshgrid() creates coordinate matrices from coordinate vectors, needed for 3D surface plots.
What does the Z array represent in a 3D surface plot?
✗ Incorrect
Z holds the values that define the surface height at each X and Y coordinate.
Which import is necessary to enable 3D plotting in matplotlib?
✗ Incorrect
The Axes3D class from mpl_toolkits.mplot3d enables 3D plotting.
How do you add a 3D subplot to a matplotlib figure?
✗ Incorrect
Use projection='3d' to create a 3D subplot.
Which parameter controls the color style of a 3D surface plot?
✗ Incorrect
The cmap parameter sets the color map for the surface.
Explain the steps to create a 3D surface plot using matplotlib.
Think about data preparation, figure setup, and plotting function.
You got /5 concepts.
Describe how changing the color map affects a 3D surface plot.
Consider how colors help show data differences.
You got /4 concepts.