Matlab中set |
您所在的位置:网站首页 › matlab中set用法 › Matlab中set |
Matlab 中 set-gca 函数的使⽤ Matlab坐标修改gca 1、 坐标轴删除 set(gca,’xtick’,[]) %去掉x轴的刻度 set(gca,’ytick’,[]) %去掉y轴的刻度 set(gca,’xtick’,[],’ytick’,[]) %同时去掉x轴和y轴的刻度 2、 Matlab中“坐标轴刻度”的不同风格 set(gca,’xtick’,[]) %去掉x轴的刻度 set(gca,’ytick’,[]) %去掉y轴的刻度 set(gca,’xtick’,[],’ytick’,[]) %同时去掉x轴和y轴的刻度 另附上Matlab坐标调整程序⼀段: x=20:10:20000; y=rand(size(x)); semilogx(x,y); set(gca,’XLim’,[20 20000]); 就是设置当前图的横轴和纵轴的范围,lim就是limite的意思。 也可以不⽤set设置,⽽直接⽤函数xlim和ylim设置 xlim(gca,[-20,20]); ylim(gca,[-20,20]); 也可以⽤函数axis设置 axis(gca,[-20,20,-20,20]) gca是get hanlde to current axis(得到当前图的句柄),除set函数外在以上函数中均可省略不写,默认就是gca。 set(gca,’XMinorTick’,’off’); %关闭精准坐标刻度 set(gca,’XTick’,[20 31.5 63 125 250 500 1000 2000 4000 8000 16000]); set(gca,’XGrid’,’on’); %绘制X轴垂直⽹格线 set(gca,’XMinorGrid’,’off’); 3、 Matlab坐标轴刻度调整 subplot(3,2,1) plot(x) title('默认格式') subplot(3,2,2) plot(x) set(gca,'xtick',[1 3 6 8]); set(gca,'ytick',[]); title('x⾃定义间隔,y关闭') subplot(3,2,3) |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |