当前位置:网站首页>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;边栏推荐
- Encryption trend: Fashion advances to the meta universe
- Sentinel哨兵机制
- 深入理解ELF文件
- 近来开发的一款简单易用的图可视化工具
- Are the top ten leading securities companies safe to open accounts
- 深度学习网路模型
- Precautions for using Jerry's timer [chapter]
- Idea global search for Chinese characters [easy to understand]
- Hover effect of eight buttons
- ASP. Net supermarket convenience store online shopping mall source code, for the surrounding distribution system
猜你喜欢

New characteristics of cultural consumption in the era of digital economy

使用DiskGenius拓展系统盘C盘的容量
![[matlab] curve fitting](/img/58/3fdcc4d34e7c7c71b73324517ff69d.png)
[matlab] curve fitting

SQL Server实时备份库要求

Using QT to make a beautiful login interface box

ASP.NET超市便利店在线购物商城源码,针对周边配送系统

Introduction to the container of() function

Acy100 oil fume concentration online monitor for kitchen oil fume emission in catering industry

A simple and easy-to-use graph visualization tool developed recently

什么是算子?
随机推荐
篇4:win10安装MingW64
怎么判断自己是否适合转行软件测试
Unity technical manual - lifecycle rotation rotationoverlifetime speed rotation rotationbyspeed external forces
Indexes
Why do we need ankeri's active power filter in frequency converter occasions?
[compilation principle] lexical analysis
Virtual machine class loading mechanism
Qt产生指定范围内随机数(随机字符串)
Is it safe for a securities company to open an account with the lowest handling fee among the top ten
启牛涨乐财付通下载是可以开户吗?开户安全吗
Sentinel哨兵机制
股票开户找人办比较方便么?在线开户安全么?
有关均衡----简易版瓶颈模型
图标丢失,URL附带JESSSIONID的什么来的?
RuntimeError: Trying to backward through the graph a second time (or directly access saved variable
Computing architecture of microblog comments
conda安装的py3.6和py3.7
CONDA modifying a mirror source
1、对范数的理解
ASP. Net supermarket convenience store online shopping mall source code, for the surrounding distribution system