subplot help plotting 12 plots in one figure

5 views (last 30 days)
Pukar
Pukar on 23 Jun 2014
Answered: Image Analyst on 23 Jun 2014
I;m trying to create a image of size 6.3 by 6.3 inches which contains 12 subplot. When i try to plot the seventh subplot it plots but the 4th one disappears any help is appreciated
set(gcf, 'PaperPositionMode', 'manual');
set(gcf, 'PaperUnits', 'inches');
set(gcf, 'PaperPosition', [0 0 6.3 6.4]);
h11 = axes('Fontsize',12,'Nextplot','add');
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,1);
set(h1,'Unit','inches','Position',[0,0,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,2);
set(h1,'Unit','inches','Position',[2.1,0,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,3);
set(h1,'Unit','inches','Position',[4.3,0,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,4);
set(h1,'Unit','inches','Position',[0,2,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,5);
set(h1,'Unit','inches','Position',[2.1,2,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,6);
set(h1,'Unit','inches','Position',[4.3,2,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,7);
set(h1,'Unit','inches','Position',[0,4,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;
load('D:\sc\Rnn');
set(gcf,'color','white')
h1=subplot(4,3,8);
set(h1,'Unit','inches','Position',[2.1,4,2.01,1.4]);
hd=imagesc(real(Rn));
set(hd,'alphadata',~isnan(Rn))
colorbar
title('H (W m^-^2)','Fontsize',10)
set(gca,'ytick',[])
set(gca,'xtick',[])
grid on
hold on;

Answers (1)

Image Analyst
Image Analyst on 23 Jun 2014
Why are you calling:
set(h1,'Unit','inches','Position',[2.1,2,2.01,1.4]);
Usually when a plot disappears it's because you've overlapped a prior plot. This could be caused by you manually adjusting the sizes of your plots, and your 7th plot overlaps some part of your 4th plot.

Tags

Community Treasure Hunt

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

Start Hunting!