matlab 设置position 位置 /xlabel/legend位置的设置方式 | 您所在的位置:网站首页 › 怎么确定笔画数字的位置 › matlab 设置position 位置 /xlabel/legend位置的设置方式 |
subplot(211) subplot('Position',[0.1 0.57 0.8 0.38]); 学习 set(gca,'Position',[0.1 0.25 0.8 0.7]); plot开始绘图就再这个区域了。 h = legend('1','2','3','4'); set(h,'box','off'); set(h,'position',[0.1 0.25 0.8 0.7]) xlabel(‘Distance',‘FontSize',12); 如果没有设置位置,默认是在中间 pos=axis; ylabel('异常值','position',[-0.06*pos(2) 1.1*pos(3)]); 其中-0.06表示Y轴图幅左右平移位置。1.1表示上下平移位置 数值很小变换会很大,要谨慎调整。 在xlabel中也有position用法1 xlabel(‘Distance',‘position',[900,1870],‘FontSize',12); 此时‘time'在你设置的位置 还有一种用法是类似图像的用法 pos=axis;%取得当前坐标轴的范围,即[xmin xmax ymin ymax] xlabel(‘Distance',‘FontSize',12, ‘Position',[pos(2) pos(3)]) x=0:pi/50:2*pi; y=sin(x); plot(x,y); pos=axis;%取得当前坐标轴的范围,即[xmin xmax ymin ymax] xlabel('x轴','position',[pos(2) 1.15*pos(3)]);%设置x轴标签的文本在图的右下方,1.15这个值根据自己的需要可以调整形成的图 set(gca,'XTick',0:pi/2:2*pi); set(gca,'XTicklabel',{'0','π/2','π','3π/2','2π'});
matlab xlabel位置的设置方式_python_脚本之家 |
CopyRight 2018-2019 实验室设备网 版权所有 |