MATLAB 不在子图上显示 x 刻度标签
MATLAB don't show x tick labels on subplots
我正在绘制 4 个子图,由于某种原因,前 2 个子图的 x 轴刻度标签没有出现在图中(x 轴标签应该是距离日期时间的小时数)。
我的代码是:
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([736886.619552373 736886.692032847]) %Limits
datetick('x','HH:MM') %change the axis to time format
我正在绘制 4 个子图,由于某种原因,前 2 个子图的 x 轴刻度标签没有出现在图中(x 轴标签应该是距离日期时间的小时数)。
我的代码是:
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([736886.619552373 736886.692032847]) %Limits
datetick('x','HH:MM') %change the axis to time format