2D and 3D Plotting Flashcards
7 cards from real MATLAB practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 2D and 3D Plotting flashcards as text
Which function adds a color bar legend to a surface plot in MATLAB?
Answer: colorbar
colorbar displays a color scale bar alongside the current axes to indicate the data values mapped to colors.
What does the 'hold on' command do in MATLAB plotting?
Answer: Allows subsequent plots to be added to the current figure without erasing existing content
'hold on' retains the current plot and its properties so that new plots added with subsequent commands are overlaid on the same axes.
In MATLAB, which property of a plot line specifies its thickness?
Answer: LineWidth
The LineWidth property controls the width of plot lines and can be set as a name-value pair in plotting functions like plot().
Which MATLAB function creates a bar chart?
Answer: bar
The bar() function creates a 2D bar chart where each data value is represented as a vertical bar.
How do you set the x-axis limits to range from 0 to 10 in MATLAB?
Answer: xlim([0 10])
xlim([min max]) sets the x-axis display limits of the current axes to the specified range.
Which MATLAB function is used to add a text label to a specific point on a plot?
Answer: text
The text(x, y, 'string') function places a text annotation at the coordinate (x, y) on the current axes.
What is the effect of calling 'axis equal' in MATLAB?
Answer: Makes the data units equal in length along each axis so circles appear round
'axis equal' sets the aspect ratio so that data units are the same length along both axes, preventing distortion of shapes like circles.