您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 制造加工工艺 > matlab中坐标轴设置技巧
Matlab中的坐标轴设置技巧Matlab中的坐标轴设置技巧axisoff;%去掉坐标轴axistight;%紧坐标轴axisequal;%等比坐标轴axis([-0.1,8.1,-1.1,1.1]);%坐标轴的显示范围x=-pi/2:0.01:pi;plot(x,sin(x))%先绘制个基本图形%gca:gca,h=figure(...);set(gca,'XLim',[-pi/2pi]);%X轴的数据显示范围set(gca,'XTick',[-pi/2:pi/4:pi]);%X轴的记号点set(gca,'XTickLabel',{'-pi/2''-pi/4:''0''pi/4''pi/2''pi*3/4''pi'})%X轴的记号set(gca,'XGrid','on');%X轴的网格set(gca,'XDir','reverse');%逆转X轴set(gca,'XColor','red');%X轴的颜色set(gac,'Xscale','log')%x轴以log形式显示xlim(min,max)matlab画图设置图片大小以及线宽和字号命令该文章讲述了matlab画图设置图片大小以及线宽和字号命令.set(gcf,'Units','centimeters','Position',[101075]);%设置图片大小为7cm×5cm%gethanldetocurrentaxis返回当前图形的当前坐标轴的句柄,%(thefirstelementistherelativedistanceoftheaxestotheleftedgeofthefigure,...%thesecondtheverticaldistancefromthebottom,andthenthewidthandheight;set(gca,'Position',[.13.17.80.74]);%设置xy轴在图片中占的比例set(get(gca,'XLabel'),'FontSize',8);%图上文字为8point或小5号set(get(gca,'YLabel'),'FontSize',8);set(get(gca,'TITLE'),'FontSize',8);set(gca,'fontsize',8);set(gca,'linewidth',0.5);%坐标线粗0.5磅set(gca,'box','off');%Controlstheboxaroundtheplottingareaset(get(gca,'Children'),'linewidth',1.5);%设置图中线宽1.5磅
本文标题:matlab中坐标轴设置技巧
链接地址:https://www.777doc.com/doc-3171820 .html