Subplot difference, Matlab 2008 and 2010

1 view (last 30 days)
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

Accepted Answer

Jan
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.
  1 Comment
Kevin Dutton
Kevin Dutton on 22 Nov 2011
I tried the code you supplied, and there were no differences. I should add that Matlab 2010 was running on a desktop with dual monitors, and 2008 was running on a laptop. I modified the configuration to have a single monitor on each, with the same screensize, and the code that I originally supplied still performed differently. So I'll assume, as you say, that the matlabrc or other initialization scripts are a bit different between the two versions on my computers.

Sign in to comment.

More Answers (1)

Kevin Dutton
Kevin Dutton on 22 Nov 2011
I renamed the 2010 subplot.m to subplot.m.orig, and copied the 2008 subplot.m to the 2010 Matlab directory (C:\Program Files\MATLAB\R2010a\toolbox\matlab\graph2d) and now the test code I supplied operates the same on both machines.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!