xticklabel xtick 在matlab里有什么区别x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xtick',-pi:pi/2:pi) x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'}) x=-pi:.1
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 02:34:02
xticklabel xtick 在matlab里有什么区别x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xtick',-pi:pi/2:pi) x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'}) x=-pi:.1
xticklabel xtick 在matlab里有什么区别
x=-pi:.1:pi
y=sin(x);
plot(x,y)
set(gca,'xtick',-pi:pi/2:pi)
x=-pi:.1:pi
y=sin(x);
plot(x,y)
set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'})
x=-pi:.1:pi
y=sin(x);
plot(x,y)
set(gca,'xtick',-pi:pi/2:pi)
set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'})
xticklabel xtick 在matlab里有什么区别x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xtick',-pi:pi/2:pi) x=-pi:.1:piy=sin(x);plot(x,y)set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'}) x=-pi:.1
简单点儿说吧:xtick是刻度(小竖线);xticklabel 刻度值(竖线下面的数值).
set(gca,'xtick',-pi:pi/2:pi)这句的意思是:手动设置x轴刻度,-pi到pi之间,每间隔pi/2,划一小竖线;
set(gca,'xticklabel',{'-pi','-pi/2','0','pi/2','pi'})这句的意思是:给刚才划上的小竖线,标个数值.如果你把它改成:set(gca,'xticklabel',{'a','b','c','d','e'}),那么那小竖线下就变成:a,b,c,d,e了.
希望对你有用!