当前位置:网站首页>Matlab中图形对象属性gca使用
Matlab中图形对象属性gca使用
2022-06-25 18:01:00 【jk_101】
目录
gca的作用是获得当前坐标区或图
语法
ax = gca说明
ax = gca 返回当前图窗中的当前坐标区(或独立可视化)。使用 ax 获取和设置当前坐标区的属性。如果当前图窗中没有坐标区或图,则 gca 会创建一个笛卡尔坐标区对象。
示例
指定当前坐标区的属性
绘制一个正弦波。如图所示:
x = linspace(0,10);
y = sin(4*x);
plot(x,y)
设置当前坐标区的字体大小、刻度方向、刻度长度以及 y 坐标轴范围。使用 gca 指代当前坐标区。
x = linspace(0,10);
y = sin(4*x);
%%
ax = gca; % current axes
ax.FontSize = 12;
ax.TickDir = 'out';
ax.TickLength = [0.02 0.02];
ax.YLim = [-2 2];
%%
plot(x,y)
当前坐标区
当前坐标区是许多图形命令的默认目标对象,如 plot、title 和 xlim。以下类型的对象可以成为当前坐标区。通常,当前坐标区是所创建、点击或绘制的下列对象中的最后一个对象。
Axes 对象。
PolarAxes 对象。
GeographicAxes 对象。
独立可视化,它是出于特殊目的设计的图,其工作方式独立于其他图。例如,heatmap 是一个独立可视化,用于观察表数据中两个变量之间的交互。
图窗的 CurrentAxes 属性存储其当前坐标区。
提示
通过用户交互方式可以更改当前坐标区或图。更好的做法是在创建坐标区或图时将其赋给某个变量,而不是依赖 gca。
更改当前图窗也会更改当前坐标区或图。
在绘图后再设置坐标区属性,因为某些绘图函数会重置坐标区属性。
要访问当前坐标区或图而不强制创建笛卡尔坐标区,请使用圆点表示法查询图窗的 CurrentAxes 属性。如果不存在当前坐标区,MATLAB 将返回一个空数组。
fig = gcf;
ax = fig.CurrentAxes;边栏推荐
- 解析数仓lazyagg查询重写优化
- SQL Server real time backup library requirements
- Introduction to microservices
- CGI connects to database through ODBC
- conda 修改镜像源
- Py3.6 and py3.7 installed by CONDA
- Encryption trend: Fashion advances to the meta universe
- [matlab] curve fitting
- Using QT to make a beautiful login interface box
- Video production material website arrangement
猜你喜欢

HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报

20 provinces and cities announce the road map of the meta universe

Deep understanding of ELF files
![Jerry's system clock setting is reset or invalid [chapter]](/img/c6/ee6b287af7d309f98abda8e11d674c.png)
Jerry's system clock setting is reset or invalid [chapter]

什么是算子?

Introduction to microservices

Deeply understand and grasp the basic characteristics of digital economy

HMS core machine learning service realizes simultaneous interpretation, supports Chinese-English translation and multiple voice broadcast

【工作小技巧】刚入职的软件测试工程师怎么快速上手新岗位

Centos7 installing redis 7.0.2
随机推荐
篇5:VS2017搭建QT5.9.9开发环境
CentOS7 安装 Redis 7.0.2
Bilstm and CRF
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
conda安装的py3.6和py3.7
延时函数如何延时
Swagger implements background interface automation document
[compilation principle] overview
SDN system method | 10 The future of SDN
Is the actual account opening complicated? Is online account opening safe?
证券公司排名前十手续费最低 办理开户安全吗
篇4:win10安装MingW64
TLV decoding
Sentinel sentinel mechanism
Android物联网应用程序开发(智慧园区)—— 图片预览界面
Qt产生指定范围内随机数(随机字符串)
Distributed remote management of distribution room environment
Computing architecture of microblog comments
Use diskgenius to expand the capacity of system disk C
container of()函数简介