0
0
MATLABdata~5 mins

Subplot for multiple panels in MATLAB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the subplot function do in MATLAB?
It divides the figure window into a grid of smaller axes (panels) and selects one for plotting.
Click to reveal answer
beginner
How do you create a 2-by-3 grid of plots and select the 4th panel?
Use subplot(2, 3, 4). This means 2 rows, 3 columns, and the 4th panel is active.
Click to reveal answer
intermediate
What happens if you call subplot multiple times with the same position?
The new plot replaces the old one in that panel, clearing previous content.
Click to reveal answer
beginner
How can you add a title to each subplot panel?
After calling subplot, use title('Your Title') to add a title to that panel.
Click to reveal answer
intermediate
How to create a 2x2 subplot and plot different data in each panel?
Call subplot(2,2,i) for i=1 to 4, then plot data in each selected panel separately.
Click to reveal answer
What does subplot(3,1,2) do?
ACreates a grid with 3 rows, 1 column, and selects the 2nd panel
BCreates a grid with 1 row, 3 columns, and selects the 2nd panel
CCreates a grid with 3 rows, 1 column, and selects the 3rd panel
DCreates a grid with 2 rows, 3 columns, and selects the 1st panel
If you want 4 plots in one figure arranged in 2 rows and 2 columns, which command is correct to select the last panel?
Asubplot(1,4,4)
Bsubplot(2,2,4)
Csubplot(4,1,2)
Dsubplot(2,4,4)
What happens if you plot twice on the same subplot without holding on?
AThe second plot replaces the first
BBoth plots appear together
CAn error occurs
DThe figure window closes
How do you add a title to a specific subplot?
AUse <code>figure</code> to add a title
BUse <code>subplot</code> with a title argument
CCall <code>title</code> after selecting the subplot
DTitles cannot be added to subplots
Which command creates a 3x2 grid of subplots?
Asubplot(1,6,1)
Bsubplot(2,3,1)
Csubplot(6,1,1)
Dsubplot(3,2,1)
Explain how to create multiple panels in one figure using subplot in MATLAB.
Think of dividing a window into smaller boxes and drawing in each box.
You got /3 concepts.
    Describe how to add titles and labels to individual subplot panels.
    Each panel is like a mini-plot with its own decorations.
    You got /3 concepts.