difficulties with datetick and subplot dimensions

조회 수: 5 (최근 30일)
Richard
Richard 2012년 12월 3일
I have several time series that I am trying to analyse and I am plotting all the series in different subplots and scatter plots. The date vector I have is in Julian dates, and I am having some problems in visualising the dates without it affecting the figure quality. Consider the following:
dat = 1-(20-1).*rand(365,8);
dat2 = 1-(20-1).*rand(365,8);
time = datenum('2009-01-01'):datenum('2009-12-31');
dtt = {'keepticks'};
for i = 1:8;
for ii = 1:2;
figure(ii);
ax = subplot(4,2,i);
plot(time,dat(:,i),'k');
hold on;
plot(time,dat2(:,i),'r');
if ii == 1;
datetick('x','mmm','keepticks');
else
datetick('x','mmm');
end
AX = get(ax,'position');
AX(3) = AX(3)./2;
set(ax,'position',AX);
axes('position',[AX(1)+AX(3) AX(2) AX(3) AX(4)]);
scatter(dat(:,i),dat2(:,i));
end
end
As you see, the difference between figure 1 and figure 2 is that in one I have specified to 'keepticks' (which is what I would like to do), but the two final plot dimensions vary, the format of the plots should be like figure 2. Why is this happening? How could I use keepticks but also have the subplots to maintain their dimensions?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Axes Appearance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by