x=0:0.01:2*pi;
y=sin(x);
plot(x,y)
xlabel('正弦函数')

效果:

多行

xlabel({'正弦函数','sin'})

 

特殊字符

xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'})

 

改变大小及加粗

xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'},'FontSize',12,'FontWeight','bold')

 

改变字体及颜色

xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'}, 'FontSize',12,'FontWeight','bold','color','r','Fontname','STFangSong')

 subplot()

x=0:0.01:2*pi;
y=sin(x);
subplot(2,3,1)
plot(x,y)
xlabel('正弦函数')

subplot(2,3,2)
plot(x,y)
xlabel({'正弦函数','sin'})


subplot(2,3,3)
plot(x,y)
xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'})

subplot(2,3,4)
plot(x,y)
xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'},'FontSize',12,'FontWeight','bold')

subplot(2,3,5)
plot(x,y)
xlabel({'正弦函数','sin','-2\pi \leq x \leq 2\pi'}, 'FontSize',12,'FontWeight','bold','color','r','Fontname','STFangSong')

参考:

https://jingyan.baidu.com/article/19020a0a600645529d284228.html 

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐