MATLAB 的 figure 用法总结

news2024/10/5 13:45:14

文章目录

  • Syntax:
  • Description
  • Examples
    • 1.figure
    • 2.figure(Name,Value)
      • Position 属性: 设置 Figure 的位置和大小
      • Name 属性: 设置 Figure 的名称
      • NumberTitle 属性: 取消 Figure 名称里默认的数字
      • units 属性
      • color 属性
    • 3.f = figure(___)
    • 4.Working with Multiple Figures Simultaneously
    • 5.figure(f) 和 figure(n)

Syntax:

  • figure
  • figure(Name,Value)
  • f = figure(___)
  • figure(f)
  • figure(n)

Description

1.figure

用法:figure creates a new figure window using default property values. The resulting figure is the current figure.

2.figure(Name,Value)

用法:figure(Name,Value) modifies properties of the figure using one or more name-value pair arguments. For example, figure(‘Color’,‘white’) sets the background color to white.

3.f = figure(___)

用法:f = figure(___) returns the Figure object. Use f to query or modify properties of the figure after it is created.

4.figure(f)

用法:figure(f) makes the figure specified by f the current figure and displays it on top of all other figures.

5.figure(n)

用法:figure(n) finds a figure in which the Number property is equal to n, and makes it the current figure. If no figure exists with that property value, MATLAB creates a new figure and sets its Number property to n.

Examples

1.figure

Create a default figure.

如图:

在这里插入图片描述

2.figure(Name,Value)

Example: figure(‘Color’,‘white’) creates a figure with a white background.

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (’ '). You can specify several name and value pair arguments as Name1,Value1,…,NameN,ValueN.

Position 属性: 设置 Figure 的位置和大小

Position 属性的值为一个向量: [left bottom width height].

Location and size of the drawable area, specified as a vector of the form [left bottom width height]. This area excludes the figure borders, title bar, menu bar, and tool bars. (此区域不包括图形边框、标题栏、菜单栏和工具栏。)

ElementDescription
leftright-aligned Distance from the left edge of the primary display to the inner left edge of the window. This value can be negative on systems that have more than one monitor. If the figure is docked, then this value is relative to the Figure panel within the MATLAB desktop. (主显示器左边缘到窗口内左边缘的距离。在具有多个监视器的系统上,此值可能为负值。如果图形停靠,则此值相对于MATLAB桌面中的图形面板。)
bottomDistance from the bottom edge of the primary display to the inner bottom edge of the window. This value can be negative on systems that have more than one monitor. (主显示器底边缘到窗口内底边缘的距离。在具有多个监视器的系统上,此值可能为负值。)
widthDistance between the right and left inner edges of the figure. (图形的左右内边缘之间的距离。)
heightDistance between the top and bottom inner edges of the window. (窗户的上下内缘之间的距离。)

All measurements are in units specified by the Units property.

You cannot specify the figure Position property when the figure is docked.

In MATLAB Online™, the bottom and left elements of the Position vector are ignored.

To place the full window, including the borders, title bar, menu bar, tool bars, use the OuterPosition property.

所有测量的单位都是由units属性指定的。

当图形停靠时,不能指定图形位置属性。

在MATLAB Online™中,位置向量的底部和左侧元素被忽略。

要放置整个窗口,包括边框、标题栏、菜单栏、工具栏,请使用OuterPosition属性。

If the figure is docked, then this value is relative to the Figure panel within the MATLAB desktop. (如果图形停靠,则此值相对于MATLAB桌面中的图形面板。)

在这里插入图片描述

Name 属性: 设置 Figure 的名称

Name — Name
‘’ (default) | character vector | string scalar

Name of the figure, specified as a character vector or a string scalar.

Example: figure(‘Name’,‘Results’) sets the name of the figure to ‘Results’.

By default, the name is ‘Figure n’, where n is an integer. When you specify the Name property, the title of the figure becomes ‘Figure n: name’. If you want only the Name value to appear, set IntegerHandle or NumberTitle to ‘off’.

在这里插入图片描述

NumberTitle 属性: 取消 Figure 名称里默认的数字

在这里插入图片描述

units 属性

Units — Units of measurement

‘pixels’ (default) | ‘normalized’ | ‘inches’ | ‘centimeters’ | ‘points’ | ‘characters’

Units of measurement, specified as one of the values. (测量单位,指定为这些值中的一个值。)

1.‘pixels’ (default): Pixels. Starting in R2015b, distances in pixels are independent of your system resolution on Windows and Macintosh systems:

  • On Windows systems, a pixel is 1/96th of an inch.
  • On Macintosh systems, a pixel is 1/72nd of an inch.

On Linux® systems, the size of a pixel is determined by your system resolution.

2.‘normalized’: These units are normalized with respect to the parent container. The lower-left corner of the container maps to (0,0) and the upper-right corner maps to (1,1). (这些单元相对于父容器是规范化的。容器的左下角映射到(0,0),右上角映射到(1,1)。)

3.‘inches’: Inches.

4.‘centimeters’: Centimeters.

5.‘points’: Points. One point equals 1/72nd of an inch.

6.‘characters’: These units are based on the default uicontrol font of the graphics root object:

  • Character width = width of the letter x.
  • Character height = distance between the baselines of two lines of text.

To access the default uicontrol font, use get(groot,‘defaultuicontrolFontName’) or set(groot,‘defaultuicontrolFontName’).

要访问默认的uicontrol字体,使用get(root,‘defaultuicontrolFontName’)或set(root,‘defaultuicontrolFontName’)。

MATLAB measures all units from the lower left corner of the parent object.

This property affects the Position property. If you change the Units property, consider returning its value to the default value after completing your computation to avoid affecting other functions that assume the default value.

The order in which you specify the Units and Position properties has these effects:

If you specify the Units before the Position property, then MATLAB sets Position using the units you specify.

If you specify the Units property after the Position property, MATLAB sets the position using the default Units. Then, MATLAB converts the Position value to the equivalent value in the units you specify.

MATLAB从父对象的左下角开始测量所有单位。

此属性影响Position属性。如果您更改了Units属性,请考虑在完成计算后将其值返回为默认值,以避免影响使用默认值的其他函数。

指定单位和位置属性的顺序有以下效果:

如果您在位置属性之前指定单位,那么MATLAB将使用您指定的单位设置位置。

如果在Position属性之后指定Units属性,MATLAB将使用默认的Units设置位置。然后,MATLAB将Position值转换为您指定的单位的等效值。

color 属性

Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name. If you specify ‘none’, the background color appears black on screen, but if you print the figure, the background prints as though the figure window is transparent.

For a custom color, specify an RGB triplet or a hexadecimal color code.

  • An RGB triplet is a three-element row vector whose elements specify
    the intensities of the red, green, and blue components of the color.
    The intensities must be in the range [0,1], for example, [0.4 0.6
    0.7].
  • A hexadecimal color code is a character vector or a string scalar
    that starts with a hash symbol (#) followed by three or six
    hexadecimal digits, which can range from 0 to F. The values are not
    case sensitive. Therefore, the color codes “#FF8800”,
    “#ff8800”,“#F80”, and “#f80” are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

在这里插入图片描述
Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

在这里插入图片描述
如图:

在这里插入图片描述

3.f = figure(___)

f is this figure object.

一个 figure 的所有 property,即所有属性:

在这里插入图片描述

在这里插入图片描述

使用 f 修改图片的属性来修改图片, 前提是图片存在, 要是把图片删除了则修改属性的语句会报错.

在这里插入图片描述

4.Working with Multiple Figures Simultaneously

有多个 Figure 同时存在时, 位于最前面的那个 Figure 就是当前活动的 Figure, 画出的图线会画在 Figure 上. 如图:

在这里插入图片描述

5.figure(f) 和 figure(n)

使用此命令可以选中某个 Figure 作为当前活跃窗口. 如图:

在这里插入图片描述

input argument f is target figure object.

input argument n is target figure number.

Target figure number, specified as a scalar integer value. When you specify this argument, MATLAB searches for an existing figure in which the Number property is equal to n. If no figure exists with that property value, MATLAB creates a new figure and sets its Number property to n. By default, the Number property value is displayed in the title of the figure.
(目标图形编号,指定为标量整数值。当指定此参数时,MATLAB将搜索Number属性等于n的现有图形。如果不存在具有该属性值的图形,MATLAB将创建一个新图形,并将其Number属性设置为n。默认情况下,Number属性值显示在图的标题中。)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/977655.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

JAVA反序列化漏洞复现

Weblogic(CVE-2017-10271) 拉取容器 访问 http://192.168.142.151:7001/console/login/LoginForm.jsp ​ 启动nacs 进行漏洞扫描 下载weblogicScanner工具 git clone https://github.com/0xn0ne/weblogicScanner.git 开始扫描 访问http://192.168.1…

数据结构队列

数据结构队列 队列的概念及结构队列的是实现数据结构函数接口初始化销毁入队列(尾插)出队列(头删)求队列的长度判断队列是否为空取队头的数据取队尾的数据 队列的概念及结构 队列之允许在一段及进行数据插入操作,在另…

LeetCode 356. Line Reflection【数学,哈希表】中等

本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章…

IO day1

1->x.mind 2-> 3->计算一个文件的大小,计算一个文件有几行。封装成函数

MyBatisPlus查询条件设置、映射匹配兼容性、id生成策略、多数据操作

🐌个人主页: 🐌 叶落闲庭 💨我的专栏:💨 c语言 数据结构 javaEE 操作系统 石可破也,而不可夺坚;丹可磨也,而不可夺赤。 MyBatisPlus 一、 查询条件设置二、 映射匹配兼容…

数据结构day7栈-链式栈原理及实现

全部代码&#xff1a; main.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "linkstack.h"int main(int argc, char *argv[]) {linkstack s;s stack_create();if(s NULL){return -1;}stack_push(s, 10);stack_push(s…

[图文并茂]C++线性表及其逻辑结构

1.1线性表的定义 线性表是具有相同特性的数据元素的一个有限序列 对应的逻辑结构图形&#xff1a; 从线性表的定义中可以看出它的特性&#xff1a; &#xff08;1&#xff09;有穷性&#xff1a;一个线性表中的元素个数是有限的 &#xff08;2&#xff09;一致性&#xff1a…

注册登录首选,趣味滑块验证码

前言 注册登录账户时&#xff0c;保障账户安全是首要任务&#xff01;使用趣味滑块验证码&#xff0c;既能有效防御恶意攻击&#xff0c;又能为验证过程增添一丝乐趣。让注册和登录变得更加有趣又安全&#xff01; HTML代码 <script src"https://cdn6.kgcaptcha.co…

Ubutnu python2与python3切换

python -V #查看默认版本 Python 2.7.17 python3 -V #查看电脑3的版本 Python 3.6.9 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2 #设置两个版本的…

【Linux】虚拟地址空间理解

虚拟地址空间 虚拟地址是操作系统管理内存的一种方式。**方便不同进程使用的虚拟地址彼此隔离。方便物理内存中不相邻的内存在虚拟地址上视为连续的来使用。虚拟地址和物理地址的映射是通过MMU页表进行的。虚拟内存对实际内存有保护作用。

LeetCode(力扣)17. 电话号码的字母组合Python

LeetCode17. 电话号码的字母组合 题目链接代码 题目链接 https://leetcode.cn/problems/letter-combinations-of-a-phone-number/ 代码 class Solution:def __init__(self):self.letterMap ["", # 0"", # 1"abc", # 2"def&qu…

备战9月9日C/C++青少年等级考试(1~8级)

由中国电子学会举办的《全国青少年软件编程等级考试》将于9月9日&#xff08;周六&#xff09;举行&#xff0c;你准备的怎么样了&#xff1f;我在这里列举了1~8级的历届真题及解析&#xff0c;希望能助你考试通过&#xff01;&#xff01;&#xff01; C/C编程一级 一级标准 …

Go调用jenkins api执行流水线构建与停止

用到的库&#xff1a; "github.com/bndr/gojenkins" 代码如下&#xff0c;一次到位&#xff1a; import ("context""fmt""time""github.com/bndr/gojenkins" )// 构建指定任务 func buildJob(ctx context.Context, jenkins…

CUDA 问题 ,一直头大。。。。

1.卸载cuda ubuntu系统安装/卸载cuda和cudnn_怎么删除cudnn_Zhijun.liStudio的博客-CSDN博客ubuntu系统安装/卸载cuda和cudnn_怎么删除cudnnhttps://blog.csdn.net/weixin_45921929/article/details/128849198?ops_request_misc%257B%2522request%255Fid%2522%253A%252216939…

机器学习算法系列————决策树(二)

1.什么是决策树 用于解决分类问题的一种算法。 左边是属性&#xff0c;右边是标签。 属性选择时用什么度量&#xff0c;分别是信息熵和基尼系数。 这里能够做出来特征的区分。 下图为基尼系数为例进行计算。 下面两张图是对婚姻和年收入的详细计算过程&#xff08;为GINI系…

Hive_Hive统计指令analyze table和 describe table

之前在公司内部经常会看到表的元信息的一些统计信息&#xff0c;当时非常好奇是如何做实现的。 现在发现这些信息主要是基于 analyze table 去做统计的&#xff0c;分享给大家 实现的效果某一个表中每个列的空值数量&#xff0c;重复值数量等&#xff0c;平均长度 具体的指令…

Freecycle出现大规模数据泄露事件,影响700万用户

Freecycle是一个致力于交换二手物品的在线论坛&#xff0c;拥有来自全球5300多个地方城镇的近1100万名用户。该论坛近日发生了大规模数据泄露事件&#xff0c;700 多万用户受到影响。 该组织称是在上周三&#xff08;8月30日&#xff09;发现这一漏洞的&#xff0c;而在此之前…

Nand Flash的特性及烧录问题

目录 前言 一 Nand flash的特性 1 存储结构 2 OOB区域 3 位翻转 4 坏块及ECC 二 Nand系统裸片量产烧录 1 坏块处理策略 2 分区(Partition) 3 纠错码(Error Correction Codes&#xff0c;ECC) 4. 擦除坏块 &#x1f388;个人主页&#x1f388;&#xff1a;linux_嵌入式…

LeetCode(力扣)39. 组合总和Python

LeetCode20. 有效的括号 题目链接代码 题目链接 https://leetcode.cn/problems/combination-sum/description/ 代码 class Solution:def backtracking(self, candidates, stratindex, path, target, result, total):if total > target:returnif total target:result.ap…

php://filter协议在任意文件读取漏洞(附例题)

php://filter php://fiter 中文叫 元器封装&#xff0c;咱也不知道为什么这么翻译&#xff0c;目前我的理解是可以通过这个玩意对上面提到的php IO流进行处理&#xff0c;及现在可以对php的 IO流进行一定操作。 过滤器&#xff1a;及通过php://filter 对php 的IO流进行的具体…