0
在下面的代碼中,我想將每個子圖中x軸的刻度數從2增加到4(或者一般情況下增加到我想要的任意數量)。目前,它只顯示上午12點至12點。任何幫助將不勝感激。如何增加在datetick中顯示的xticks的數量?
x=rand(96,1);
y=rand(96,1);
z=rand(96,1);
Ts=900;
t = 0:Ts:24*3600-Ts; %time in second
time = datestr(t/86400+datenum(2014,1,1)); %time starting at 2014/01/01
subplot(1,3,1)
ts_x = timeseries(x, time);
plot(ts_x)
datetick('x','HHPM')
ax = gca;
ax.XTickLabelRotation = 90;
set(gca,'fontsize',16)
subplot(1,3,2)
ts_y = timeseries(y, time);
plot(ts_y)
datetick('x','HHPM')
ax = gca;
ax.XTickLabelRotation = 90;
set(gca,'fontsize',16)
subplot(1,3,3)
ts_z = timeseries(y, time);
plot(ts_z)
datetick('x','HHPM')
ax = gca;
ax.XTickLabelRotation = 90;
set(gca,'fontsize',16)
或者不是你的第三行:'datetick('x','HHPM','keepticks')' –
完美!非常感謝你。 – user3489173