目录
1. 坐标轴字体
1.1 默认坐标轴
figure(1);
plot(x, y1,'r--', x, y2,'b-', 'LineWidth',2);
set(gca,'FontSize',13,'FontWeight','bold','Fontname', 'Times New Roman');
1.2 设定坐标轴
# x轴为“正弦函数 sin -2π ≤ x ≤ 2π”
xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'}, 'FontSize',12,'FontWeight','bold','color','r','Fontname','STFangSong')
# 图例
legend('Output1','Output2','Location','NorthEast', 'FontSize',13,'FontWeight','bold', 'Fontname','Times New Roman');
2. 坐标轴时刻
2.1 准备工作
先准备单元格属性为“数值”的Excel时间表,数据如图:
# 读入时间Excel
T = xlsread('time.xlsx');
# 提取每个sheet中的速度列
T(:,8) = datenum(T(:,2),T(:,3),T(:,4),T(:,5),T(:,6),T(:,7));
x = T(:,8);
figure(1);
plot(x, y1,'r--', x, y2,'b-', 'LineWidth',2);
# 函数数字选择见下图
dateaxis('x',15);