How to use subplot to keep the aspect ratios of the individual plots?
26 views (last 30 days)
Show older comments
Hi all!
at the moment i have the following problem:
i use "plot" to get some nice plots of concentration-time profiles (x-axis: Time, y-axis: Concentration). Now i want to plot two x-y-plots side by side without loosing the look (ratio of x-axis to y-axis) of the original/individual plots? Can i do that with subplot? When i use subplot the first plot goes to subplot(1,2,1) and the second to subplot(1,2,2). The problem is, that the space for the x-axes is shrunken to half of the original size. So that the x-axes are much shorter than the y-axes.
Is it possible to plot the two x-y-plots side-by-side in a way that they look as if they were plotted "alone" using subplot?
I hope i could make my problem understandable :)
Thank you in advance! Darax
0 Comments
Answers (1)
Daniel Armyr
on 2 Feb 2016
This function changes the aspect ratio of plots: http://se.mathworks.com/help/matlab/ref/pbaspect.html
There is even a specific example that looks exactly like what you are describing:
ax1 = subplot(2,1,1);
surf(peaks)
ax2 = subplot(2,1,2);
plot(peaks)
pbaspect(ax2,[2 1 1])
See Also
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!