【 MATLAB 】gca 介绍(当前轴或图表)
gca
Current axes or chart
Syntax
ax = gca
Description
returns the current axes or chart for the current figure, which is typically the last one created or clicked with the mouse.ax
= gca
返回当前图形的当前轴或图表,通常是用鼠标创建或单击的最后一个轴。ax
= gca
Graphics functions, such as title
, target the current axes or chart. Use ax
to access and modify properties of the axes or chart. If axes or charts do not exist, then gca
creates Cartesian axes.
图形功能(例如标题)以当前轴或图表为目标。 使用ax访问和修改轴或图表的属性。 如果轴或图表不存在,则gca创建笛卡尔坐标轴。
Specify Properties for Current Axes
Plot a sine wave.
x = linspace(0,10);
y = sin(4*x);
plot(x,y)
Set the font size, tick direction, tick length, and y-axis limits for the current axes. Use gca to refer to the current axes.
Note: Starting in R2014b, you can use dot notation to set properties. If you are using an earlier release, use the docid:matlab_ref.f67-432995 function instead, such as set(ax,'FontSize',12).
ax = gca; % current axes
ax.FontSize = 12;
ax.TickDir = 'out';
ax.TickLength = [0.02 0.02];
ax.YLim = [-2 2];
Tips
User interaction can change the current axes or chart. It is better to assign the axes or chart to a variable when you create it instead of relying on
gca
.用户交互可以更改当前轴或图表。 最好在创建变量时将轴或图表分配给变量,而不是依赖于gca。
Changing the current figure also changes the current axes or chart.
更改当前图形也会更改当前轴或图表。
Set axes properties after plotting since some plotting functions reset axes properties.
绘图后设置轴属性,因为某些绘图功能会重置轴属性。
To access the current axes or chart without forcing the creation of Cartesian axes, query the figure
CurrentAxes
property. MATLAB® returns an empty array if there is no current axes.要在不强制创建笛卡尔坐标轴的情况下访问当前轴或图表,请查询图形CurrentAxes属性。 如果没有当前轴,MATLAB®将返回一个空数组。
fig = gcf; ax = fig.CurrentAxes;Starting in R2014b, you can query properties using dot notation. If you are using an earlier release, use the
get
function instead, such asax = get(fig,'CurrentAxes')
.- 从R2014b开始,您可以使用点表示法查询属性。 如果您使用的是早期版本,请改用get函数,例如
ax = get(fig,'CurrentAxes')
.
上例中,如果加入语句:
fig = gcf; ax = fig.CurrentAxes;
则得到:
ax =
Axes - 属性:
XLim: [0 2]
YLim: [-100 20]
XScale: 'linear'
YScale: 'linear'
GridLineStyle: '-'
Position: [0.1300 0.1100 0.7750 0.8150]
Units: 'normalized'
【 MATLAB 】gca 介绍(当前轴或图表)相关推荐
- matlab中emd函数,EMD算法的matlab程序介绍解析
<EMD算法的matlab程序介绍解析>由会员分享,可在线阅读,更多相关<EMD算法的matlab程序介绍解析(6页珍藏版)>请在人人文库网上搜索. 1.此版本为 ALAN 版 ...
- MATLAB工具箱介绍
MATLAB工具箱介绍 Toolbox工具箱 序号 工具箱 备注 数学.统计与优化 1 Symbolic Math Toolbox 符号数学工具箱 2 Partial Differential Euq ...
- 模型预测控制(MPC)+逻辑控制(相平面分区控制)--matlab例程介绍
模型预测控制(MPC)+逻辑控制(相平面分区控制)–matlab例程介绍 MATLAB-模型模糊神经网络预测控制demo(训练数据用):链接:https://blog.csdn.net/answerM ...
- matlab2017中工具箱,【2017年整理】matlab工具箱介绍.ppt
[2017年整理]matlab工具箱介绍 第六讲 Matlab工具箱;一.工具箱简介;领域型工具箱 -- 专用型 领域型工具箱是学科专用工具箱,其专业性很强,比如控制系统工具箱( Control Sy ...
- matlab中文论坛视频谷普教程MATLAB压缩包介绍
matlab中文论坛视频谷普教程MATLAB压缩包介绍 我也正在学习这个软件 ,看到这个教程就在这里分享了,希望大家喜欢! Matlab 初学者视频教学 1. Matlab视频:Matlab中文论坛为 ...
- Matlab在线IDE:MATLAB Online介绍与计算定积分案例
目录 1.MATLAB Online介绍 功能与特点 命令行窗口和编辑器窗口 适用场景 计费方式 使用方法 2.注册登录 3.计算定积分 1.MATLAB Online介绍 MATLAB Online ...
- matlab软件介绍_活动回顾 | 您要的MATLAB课堂总结上线啦!
从筹备到举办,转眼间, 在东南珠三校举办的MATLAB讲座已落下帷幕, 但那些精彩的瞬间依然历历在目. 下面,就让我们一起来回顾一下吧! 1广州校区南校园 5月10日的晚上,李嘉老师的魅力和同学们的好 ...
- 【Matlab】你想知道在图表标题中显示变量的一切
1.Introduction 有时在利用Matlab输出结果时,会通过作图(Figure),和做表(Excel)来完成.并且经常需要在标题中显示一些变量,比如下图,那么这是怎么实现的呢?能不能显示数组 ...
- matlab bdir 排序,Matlab 2020b介绍及下载安装步骤
文章目录 1. 按2. 产品介绍3. 安装要求4. 安装步骤5. 下载地址1. 按 MATLAB下半年版本R2020b来了 此版本较上半年有了新的产品及功能更新 APP Designer更好用 .MA ...
- matlab gul介绍及串口通信实现,Matlab - GUl介绍及串口通信实现(转)
新建Blank GUI. 在新建Blank GUI界面中,包含了一般的界面元素,如菜单.按钮.坐标轴.控件等.添加必要的串口通信参数设置按钮. 2 串口数据发送与接收功能实现 2.1 建立串口通信流程 ...
最新文章
- 古罗马皇帝凯撒在打仗时曾经使用过以下方法加密军事情报: 请编写一个程序,使用上述算法加密或解密用户输入的英文字串...
- C/C++得到系统启动项
- Python爬虫项目,获取所有网站上的新闻,并保存到数据库中,解析html网页等(未完待续)
- web 项目集成福昕_项目学生:Web服务集成
- Gitee 上线多项 PR 功能优化,进一步提升审查与提交效率
- 让你的sublime text写C代码 (sublime text 2 配置构建C开发环境)
- vestacp升级php,升级VestaCP面板PHP版本至PHP7.x
- python︱批量操作文件(os)、图片操作技巧(下载网络图片、skimage.io)
- cordova android 开发,Cordova开发App入门(一)创建android项目
- 六自由度机械臂SolidWorks模型转化成urdf文件,添加简单gazebo属性并修改为xacro
- 2020年下半期第一次实训
- ArrayList:获取最大元素?获取最大元素索引?
- WebGL空间变换以及gl_FragCoord的运用
- 数据库(MySQL + Redis)
- 应届生如何准备校招,用我这一年的校招经历告诉你
- b2b电子商务研究报告
- 异形3×3魔方还原教程_2345异形魔方教程
- 如何防止uniswap/pancakeswap被机器人夹
- ACM数论专题3——素数(质数)
- 亚马逊跨境电商美国站店铺产品运营是什么?亚马逊美国站店铺产品开发主要做什么?