Matlab绘图基础——axis设置坐标轴取值范围

本文介绍了Matlab中axis命令的使用,包括设置坐标轴取值范围、坐标轴方向、在原图上继续作图以及创建灰度统计图。通过实例展示了如何调整subplot的坐标轴、冻结坐标系、改变坐标轴方向以及制作带有ColorBar的图像。
摘要由CSDN通过智能技术生成

简介

peaks;

axis tight %Set the axis limits to equal the range of the data

axis square

axis 'auto x' %x轴坐标上下限自动调整

axis off %Plot a surface without displaying the axes lines and background.

set(gca,'Visible','off'); %消除坐标轴,显示范围的大小没有改变,同上句

tmp = gca;

tmp.XAxis.Visible = 'off'; % 隐藏X轴的

% 上面一句也可以隐藏Ticks,同时Box的上端也隐藏了,这就使得图像看上去不太好看

tmp.XTick= []; % 这一句可以只隐藏Ticks

%更多特性可参考Matlab帮助文档,查找"Axes Properties"

%例一:同时设置subplot的多幅图像的axis

% Create a figure with two subplots.set the axis limits for the subplots to the same values.

x1 = linspace(0,10,100);y1 = sin(x1);

ax1 = subplot(2,1,1);plot(ax1,x1,y1)

%

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值