Subplot difference, Matlab 2008 and 2010
1 view (last 30 days)
Show older comments
I'm running the same piece of matlab code on 2 machines, one with R2008B and the other with R2010a. The code calls for a 3x1 subplot. When I run the code in R2010a all the subplots are much smaller than in 2008B.
Test code is:
x = 1:10; y = 1:10;
figure; clf;
subplot(211); plot(x,y); set(gca, 'XTickLabel', []);
title({'Two Subplots' ; 'Title 2'});
subplot(212); plot(x,y);
xlabel({ 'Xlabel 1' ; 'Xlabel 2'});
figure; clf;
subplot(311); plot(x,y); set(gca, 'XTickLabel', []);
title({'Three Subplots' ; 'Title 2'});
subplot(312); plot(x,y); set(gca, 'XTickLabel', []);
subplot(313); plot(x,y);
xlabel({ 'Xlabel 1' ; 'Xlabel 2'});
Question is - what is the difference between R2008B and R2010A that causes this, and how can I get R2010A to behave like R2008B?
Thanks
0 Comments
Accepted Answer
Jan
on 19 Nov 2011
I do not see any changes in the subplots between Matlab 5.3, 6.5, 2008a, 2008b, 2009a and 2011b. In addition the subplot size is related to the figure size, which depends on the screen size. Therefore I do not expect, that there are changes in 2010a.
Did you change the default setting for the figures in one of the Matlab versions? Please try this:
get(0, 'Default') % Display all non-factory settings
FigH = figure;
reset(FigH); % Reset to factory settings
subplot(2,3,2);
Does this produce different results? If not, the default settings have been modified in the startup.m, matlabrc.m or hgrc.m functions, which are called during starting a Matlab session.
More Answers (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!