How to shrink each figure inside a subplot ?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hello_world
am 1 Apr. 2015
Bearbeitet: hello_world
am 1 Apr. 2015
Hello Friends,
Suppose I have the following example:
figure
for ii = 1:5
subplot(1, 5, ii)
plot(ii, sin(ii));
end
This creates a figure containing 1x5 subfigures. Each of these subfigures has its own horizontal/vertical lengths which I want to shrink/increase.
Please advise!
0 Kommentare
Akzeptierte Antwort
Vinod Sudheesh
am 1 Apr. 2015
You could achieve this by modifying the "Position" (or "OuterPosition") property for each of the five individual "axes".
For example to reduce the "Width" and "Height" for each of the five individual axes to 50%, please see the code snippet below:
figure
for ii = 1:5
subplot(1, 5, ii)
plot(ii, sin(ii));
tmp=get(gca,'position');
set(gca,'position',[tmp(1) tmp(2) 0.5*tmp(3) 0.5*tmp(4)])
end
For more information on "axes properties", please refer to the following documentation page:
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
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!