当前位置:网站首页>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;边栏推荐
- bert之我的小总结
- 股票开户找人办比较方便么?在线开户安全么?
- [tips] how to quickly start a new position for a new software testing engineer
- 解析数仓lazyagg查询重写优化
- 延时函数如何延时
- 158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能
- 什么是算子?
- Bert's summary of me
- How to open a stock account? Is it safe to open a securities account
- HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报
猜你喜欢

微服务介绍
![Precautions for the use of Jerry's wake-up mouth [chapter]](/img/01/3bfba9a486eb7fa3c0a888bb3ea2d2.png)
Precautions for the use of Jerry's wake-up mouth [chapter]

Three traversal methods of binary tree (recursive + non recursive) complete code

Virtual machine class loading mechanism

篇7:CLion中没有代码提示,,,

SQL Server实时备份库要求

Intelligent dialog 01 redis installation

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

Introduction to the container of() function

移动端异构运算技术 - GPU OpenCL 编程(基础篇)
随机推荐
观察者模式之通用消息发布与订阅
New characteristics of cultural consumption in the era of digital economy
Utilisation de diskgenius pour augmenter la capacité du disque système C
Why do we need ankeri's active power filter in frequency converter occasions?
lock
什么是算子?
VSCode 自动生成头文件的#ifndef #define #endif
What is public chain development? What are the public chain development projects?
Swagger实现后台接口自动化文档
什么是算子?
Li Kou daily question - day 27 -561 Array splitting I
Using QT to make a beautiful login interface box
证券公司排名前十手续费最低 办理开户安全吗
SDN system method | 10 The future of SDN
Jerry's addition of encrypted file playback function [chapter]
Optimization of lazyagg query rewriting in parsing data warehouse
哈希竞猜游戏系统开发如何开发?哈希竞猜游戏系统开发应用详情案例及源码
Can I open an account? Is it safe to open an account
Distributed remote management of distribution room environment
How to open a stock account is it safe to open an account