Neater way to use subplots?
Show older comments
Recently, I have been using matlab for data analysis. When using subplots to compare multiple graphs at once, I have run into the problem wherein the plots look a bit sloppy when using 3 or more plots. Just for the problem's sake, I will use the variables:
a=1:5;
b=1:5;
c=1:10;
d=1:10;
e=5:15;
f=5:15;
The plots for these would be:
>> figure(1)
subplot(2,2,1)
plot(a,b)
hold on
subplot(2,2,2)
plot(c,d)
subplot(2,2,3.5)
plot(e,f)
I would like the bottom graph to be larger, potentially spanning the entire bottom of the display space. I thought changing the (m,n) variables in the subplot command would help, but it only leads to a jumbled up graph. Any advice here would be great
Accepted Answer
More Answers (1)
See
doc subplot % illustrates exactly that kind of thing...
For your case, it's
subplot(2,2,1);
...
subplot(2,2,2);
...
subplot(2,2,3:4);
NB: it's the colon operator spanning the desired mushed-together subplots.
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!