Too many Subplots causes none to show (Only axes titles show up)
2 views (last 30 days)
Show older comments
When I go to plot a 3 by 28 subplot, none of them show up in the Figure window. I have 30 images of equal size. So I wanted to plot a 3X28 matrix to have all of the graphs in one single file later. (For ease of use!)
Following is a sample of my code (It continues in the same way): %Analysis of 2Aa subplot(28,3,1); plot(t,V1); xlabel('Time in Seconds'); ylabel('Signal 2Aa in Volts'); subplot(28,3,2); hist(V1); xlabel('Signal Range of 2Aa in Volts'); ylabel('No. of data points'); subplot(28,3,3); Y1=fft(signal1(:,1),NFFT); plot(f,abs(Y1(1:NFFT/4))); xlabel('Frequency (Hz)'); ylabel('Modulus of Y(f)'); title('Fourier Spectrum')
%Analysis of 2Ab
subplot(28,3,4);
plot(t,V2);
xlabel('Time in Seconds');
ylabel('Signal 2Ab in Volts');
subplot(28,3,5);
hist(V2);
xlabel('Signal Range of 2Ab in Volts');
ylabel('No. of data points');
subplot(28,3,6);
Y1=fft(signal2(:,1),NFFT);
plot(f,abs(Y1(1:NFFT/4)));
xlabel('Frequency (Hz)');
ylabel('Modulus of Y(f)');
title('Fourier Spectrum')
Stretching each image to a [1 4], [2 5] type ordering also causes image disruption. PLS HELP! THANKS!
0 Comments
Answers (2)
Walter Roberson
on 21 Feb 2011
Resize your figure to make it bigger. With the default figure size, each subplot would be about 25 pixels wide, which is not wide enough for the borders and axes.
Alternately, look in the Matlab File Exchange for one of the scrollable image display tools.
0 Comments
n
on 21 Feb 2011
Hellow, Did you check Matlab help for subplot? :
One way to get around this issue is to enlarge the figure to create enough space to properly display the tick labels.
Another approach is to eliminate the clutter by suppressing xticks and yticks for subplots as data are plotted into them. You can then label a single axes if the subplots are stacked, as follows:
figure
for i=1:12
subplot(12,1,i)
plot (sin(1:100)*10^(i-1))
set(gca,'xtick',[],'ytick',[])
end
% Reset the bottom subplot to have xticks
set(gca,'xtickMode', 'auto')
0 Comments
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!