当前位置:网站首页>Problems of font legend and time scale display of MATLAB drawing coordinate axis

Problems of font legend and time scale display of MATLAB drawing coordinate axis

2022-07-08 01:24:00 Bosong

Catalog

1. Axis font

1.1 Default axis

1.2 Set axis

2. Axis time

2.1 preparation

2.2 Parameter selection


1. Axis font

1.1 Default axis

figure(1);
plot(x, y1,'r--', x, y2,'b-', 'LineWidth',2);
set(gca,'FontSize',13,'FontWeight','bold','Fontname', 'Times New Roman');

1.2 Set axis

# x Shaft for “ Sine function  sin -2π ≤ x ≤ 2π”
xlabel({' Sine function ','sin','-2\pi \leq x \leq 2\pi'}, 'FontSize',12,'FontWeight','bold','color','r','Fontname','STFangSong')
#  legend 
legend('Output1','Output2','Location','NorthEast', 'FontSize',13,'FontWeight','bold', 'Fontname','Times New Roman');

2. Axis time

2.1 preparation

First prepare the cell property as “ The number ” Of Excel schedule , Data as shown :

#  Read in time Excel
T = xlsread('time.xlsx');

#  Extract each sheet Speed column in 
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);

#  The function number selection is shown in the figure below 
dateaxis('x',15);

2.2 Parameter selection

原网站

版权声明
本文为[Bosong]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130542271858.html