Matlab画图坐标范围如何控制
的有关信息介绍如下:在用Matlab画图的时候,Matlab会自动确定显示图像的纵横坐标范围,如果自动显示的范围与自己想要的不一致怎么确定呢?
在此我演示长轴为3.25,短轴为1.15的椭圆。注意:采用多子图表现时,图形形状不仅受“控制指令”影响,而且受整个图面“宽高比”及“子图数目”的影响。
程序
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t=0:2*pi/99:2*pi;
x=1.15*cos(t);y=3.25*sin(t);
subplot(2,3,1)%画在两行三列图片的第1个位置
plot(x,y)
axis normal
grid on
title('Normaland Grid on')%添加图片名字
subplot(2,3,2),plot(x,y)%画在两行三列图片的第2个位置
axis equal
grid on,title('Equal')
subplot(2,3,3),plot(x,y)%画在两行三列图片的第3个位置
axis square
grid on,title('Square')
subplot(2,3,4),plot(x,y)%画在两行三列图片的第4个位置
axis image
box off
title('Image and Box off')
subplot(2,3,5),plot(x,y)%画在两行三列图片的第5个位置
axis image fill
box off,title('Image and Fill')
subplot(2,3,6),plot(x,y)%画在两行三列图片的第6个位置
axis tight
box off,title('Tight')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
将上面程序复制到Matlab中就可以画出下图。