MATLAB don';t在子批次上显示x记号标签

MATLAB don';t在子批次上显示x记号标签,matlab,plot,subplot,Matlab,Plot,Subplot,我正在绘制4个子图,出于某种原因,图中没有显示前2个子图的x轴刻度标签(x轴标签应该是从datetime开始的数小时) 我的代码是: figure subplot(2,4,1) plot(dateval,Height,'b','LineWidth',1) datetick('x','HH:MM') %change the axis to time format xlim([736886.619552373 736886.692032847]) %Limits set(gca, 'FontName

我正在绘制4个子图,出于某种原因,图中没有显示前2个子图的x轴刻度标签(x轴标签应该是从datetime开始的数小时)

我的代码是:

figure
subplot(2,4,1)
plot(dateval,Height,'b','LineWidth',1)
datetick('x','HH:MM') %change the axis to time format
xlim([736886.619552373 736886.692032847]) %Limits
set(gca, 'FontName', 'Bookman','FontSize',7);
xlabel('Time','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman')
ylabel('GPS Height $[m]$','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman','Interpreter','latex')


subplot(2,4,2)
plot(dateval,Pressure,'b','LineWidth',1)
datetick('x','HH:MM') %change the axis to time format
xlim([736886.619552373 736886.692032847]) %Limits
xlabel('Time','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman')
ylabel('Sensor Pressure $[mb]$','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman','Interpreter','latex')
set(gca, 'FontName', 'Bookman','FontSize',7);


subplot(2,4,[5 6])
scatter(Pressure,Height,3,'b','*'); %Number is the size of dots
h=lsline;
set(h,'color','r','LineWidth',2);
R=corrcoef([Pressure,Height]);
Fit = polyfit(Pressure,Height,1);
ylabel('GPS Height $$[m]$$','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman','Interpreter','latex');
xlabel('Pressure $[mb]$','FontSize',7,'FontWeight','normal','Color','k','FontName','Bookman','Interpreter','latex');
xlim([1003 1015])
ylim([0 90])
set(gca, 'FontName', 'Bookman','FontSize',7);
box on

 subplot(2,4,[3,4,7,8])
image( imread('TripMap.jpg') );
set(gca,'xtick',[])
set(gca,'xticklabel',[])
set(gca,'ytick',[])
set(gca,'yticklabel',[])
图为:

我错过了什么


谢谢

尝试更改这两行的顺序:

datetick('x','HH:MM') %change the axis to time format
xlim([736886.619552373 736886.692032847]) %Limits
致:


你能添加你的数字吗?是的-我已经编辑了我的帖子如果你分别绘制这两个图,它会绘制吗?如果它看起来正确,那么您可能只需要格式化您的刻度。否则,你的xlim可能有问题。它对滴答声有效!但是现在xlim命令不起作用了,改为datetick('x','HH:MM','keeplimits'),在我这么做之后它起作用了,并将两行移到了“set(gca..”行之后!谢谢
xlim([736886.619552373 736886.692032847]) %Limits
datetick('x','HH:MM') %change the axis to time format