刷子
互动标记图表中的数据值
描述
数据刷牙使您可以使用选择的颜色在图表中标记数据值。您可以标记单个数据值,或选择许多值使用选择矩形标记的值。标记值后,您可以将它们删除或将其保存到工作空间中的变量。刷子标记将一直持续到您删除它们,即使您平移,缩放,添加数据提示或编辑图。
大多数图表都支持数据刷牙金宝app,包括线,条,区域,直方图和表面图。支持刷牙的图表通常显示刷金宝app子图标in the axes toolbar.
创建
描述
刷
turns on brushing in the current figure. With brushing on, mark a single data value by clicking on it. Mark multiple data values by dragging a selection rectangle around them. To add additional marks or remove unwanted marks, hold the转移刷刷值时键。
刷牙
关闭刷牙。如果图表上有现有的刷子标记,则此命令将不会删除它们。
刷子
切换刷牙模式'上'
and'离开'
。
刷子((
sets the color for subsequent brush marks. Setting the brush color does not affect current marks unless you brush data, change the brush color, and then add or remove marks using the转移钥匙。在这种情况下,所有标记都更新为新颜色。颜色
)
刷子((
sets brush mode or color options for the specified figure. For example,图
,,,,___)刷子(无花果,'on')
。
创建一个b
= brush(___)刷子
目的。该语法对于控制画笔模式,颜色和回调属性很有用。
输入参数
图
-目标图
Figure
目的
目标图,,,,specified as aFigure
目的。如果您不指定图,则刷牙会影响当前图。
颜色
-Brush mark color
[1 0 0]
或红色(默认)|RGB三胞胎|颜色名称
刷子标记颜色,指定为RGB三重态或颜色名称。要创建特定颜色的刷子标记,请在刷取数据值之前设置颜色属性。设置刷子颜色不会影响电流标记,除非您刷数据,更改刷子颜色,然后使用该标记添加或删除标记转移钥匙。在这种情况下,所有标记都更新为新颜色。
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]
。另外,您可以按名称指定一些常见的颜色。该表列出了长颜色名称选项及其等效的RGB三重态值。
颜色名称 | 简称 | RGB三胞胎 | Appearance |
---|---|---|---|
'红色的' |
'r' |
[1 0 0] |
|
'绿色' |
'G' |
[0 1 0] |
|
'蓝色的' |
'b' |
[0 0 1] |
|
'cyan' |
'C' |
[0 1 1] |
|
'品红' |
'M' |
[1 0 1] |
|
'黄色' |
'y' |
[1 1 0] |
|
'黑色的' |
'K' |
[0 0 0] |
|
'白色的' |
'W' |
[1 1 1] |
|
这是默认颜色MATLAB的RGB三胞胎®uses in many types of plots.
RGB三胞胎 | Appearance |
---|---|
[0 0.4470 0.7410] |
|
[0.8500 0.3250 0.0980] |
|
[0.9290 0.6940 0.1250] |
|
[0.4940 0.1840 0.5560] |
|
[0.4660 0.6740 0.1880] |
|
[0.3010 0.7450 0.9330] |
|
[0.6350 0.0780 0.1840] |
|
特性
颜色
-Brush mark color
[1 0 0]
或红色(默认)|RGB三胞胎|颜色名称
Brush mark color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name. To create brush marks of a certain color, set the color property before brushing your data values. Setting the brush color does not affect current marks unless you brush data, change the brush color, and then add or remove marks using the转移钥匙。在这种情况下,所有标记都更新为新颜色。
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]
。十六进制的颜色代码是字符向量或字符串标量,以哈希符号开头(
#
),然后是三个或六个十六进制的数字,范围从0
toF
。The values are not case sensitive. Thus, the color codes'#FF8800'
,,,,'#ff8800'
,,,,'#F80'
,,,,and'#f80'
是等效的。
另外,您可以按名称指定一些常见的颜色。This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.
颜色名称 | 简称 | RGB三胞胎 | 十六进制的颜色代码 | Appearance |
---|---|---|---|---|
'红色的' |
'r' |
[1 0 0] |
'#ff0000' |
|
'绿色' |
'G' |
[0 1 0] |
'#00ff00' |
|
'蓝色的' |
'b' |
[0 0 1] |
'#0000FF' |
|
'cyan' |
'C' |
[0 1 1] |
'#00ffff' |
|
'品红' |
'M' |
[1 0 1] |
'#ff00ff' |
|
'黄色' |
'y' |
[1 1 0] |
'#ffff00' |
|
'黑色的' |
'K' |
[0 0 0] |
'#000000' |
|
'白色的' |
'W' |
[1 1 1] |
'#ffffff' |
|
'没有任何' |
不适用 | 不适用 | 不适用 | 没有颜色 |
这是MATLAB在许多类型的图中使用的默认颜色的RGB三重态和十六进制颜色代码。
RGB三胞胎 | 十六进制的颜色代码 | Appearance |
---|---|---|
[0 0.4470 0.7410] |
'#0072BD' |
|
[0.8500 0.3250 0.0980] |
'#D95319' |
|
[0.9290 0.6940 0.1250] |
'#EDB120' |
|
[0.4940 0.1840 0.5560] |
'#7E2F8E' |
|
[0.4660 0.6740 0.1880] |
'#77AC30' |
|
[0.3010 0.7450 0.9330] |
'#4dbeee' |
|
[0.6350 0.0780 0.1840] |
'#a2142f' |
|
Enable
-刷牙模式
'离开'
(默认)|'上'
刷牙模式,指定为'离开'
or'上'
。
ActionPrecallback
-刷牙之前执行的功能
[ ](默认)|功能句柄|cell array|角色向量
刷牙之前执行的功能,,,,specified as one of these values:
功能句柄
包含功能句柄和其他参数的单元格数组
角色向量是有效的MATLAB命令或函数,在基本工作区中评估(不建议)
当您开始刷图时,请使用此属性执行代码。如果使用函数句柄指定此属性,则在执行回调时,MATLAB将两个参数传递给回调函数:
数字
- 图对象您正在刷牙。轴结构
- 包含您刷轴的结构。该结构有一个字段,轴
,,,,the axes object you are brushing. If you do not use this argument in your callback function, then replace it with the tilde character (〜)。
For more information about how to use function handles to define callback definitions, seeCallback Definition。
ActionPostCallback
-刷牙后执行的功能
[ ](默认)|功能句柄|cell array|角色向量
刷牙后执行的功能,,,,specified as one of these values:
功能句柄
包含功能句柄和其他参数的单元格数组
角色向量是有效的MATLAB命令或函数,在基本工作区中评估(不建议)
完成刷牙后,使用此属性执行代码。如果使用函数句柄指定此属性,则在执行回调时,MATLAB将两个参数传递给回调函数:
数字
- 图对象您正在刷牙。轴结构
- 包含您刷轴的结构。该结构有一个字段,轴
,,,,the axes object you are brushing. If you do not use this argument in your callback function, then replace it with the tilde character (〜)。
For more information about how to use function handles to define callback definitions, seeCallback Definition。
ButtondownFilter
-Brush suppression callback
[ ](默认)|功能句柄|cell array|角色向量
刷抑制回调,指定为th之一ese values:
功能句柄
包含功能句柄和其他参数的单元格数组
角色向量是有效的MATLAB命令或函数,在基本工作区中评估(不建议)
Use this property to suppress brushing under conditions that you define. A numeric or logical output of 1 (true
)抑制刷子动作,以及0的数字或逻辑输出(错误的
)allows the brush action to proceed. If you specify this property using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:
轴
- 您要刷的轴对象。EventData
- 空论点。用tilde角色替换它(〜)在函数定义中,指示未使用此参数。
If you specify this property using a function handle, then you must assign the function's output to a variable.
For more information about how to use function handles to define callback definitions, seeCallback Definition。
fighandle
-图对象
Figure
目的
此属性仅阅读。
Figure
目的in which brush marks appear.
USElegacyExplorationModes
-旧模式
'离开'
(默认)|on/off logical value
遗产模式,指定为'上'
or'离开'
,或数字或逻辑1
((true
) 或者0
((错误的
)。A value of'上'
等同于true
,,,,and'离开'
等同于错误的
。因此,您可以将此属性的值用作逻辑值。该值存储为类型的ON/OFF逻辑值matlab.lang.onoffswitchstate
。
Setting this property to'上'
改变UI图中交互模式的行为,使它们与传统图中的模式的行为匹配。有关更多信息,请参阅EnableGacyExplorationModes
。
一旦将此属性设置为'上'
,它不能更改回'离开'
。
此属性仅适用于使用该图创建的数字的刷子对象uifigure
功能或INMATLABOnline™。
例子
在图表中标记数据值
Use brushing to mark data values in a scatter plot. First, plot randomX
andy
值。Then, turn on brushing and use the mouse to drag a rectangle around some points.
x = rand(20,1);y = rand(20,1);散射(x,y)刷('上')
To modify which points you have marked without discarding the entire set, hold down the转移刷牙时钥匙。单击它添加或删除单点。通过拖动选择矩形来添加或删除几个点。
通过单击或拖动在轴的空区域中清除所有刷子标记。
控制刷模式和颜色使用刷子对象
在条形图中绘制数据值并创建画笔对象。然后,启用刷牙并将刷子颜色设置为'绿色'
byupdating the object's properties. Finally, mark data values by including the maximum value of each bar in the selection rectangle.
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];bar(y)b =刷子;b.enable ='上';b.Color ='绿色';
将拉丝数据保存在变量中
使用上下文菜单将拉丝数据保存在变量中。首先,绘制一些X
andy
值。打开刷牙,然后标记一些数据值。
x = linspace(0,5,30);y = exp(x);plot(x,y) brush('上')
将拉丝数据存储在变量中,右键单击拉丝数据值,然后选择出口刷从上下文菜单。提示时,输入变量名称。在这种情况下,使用名称bdata
。Finally, view the contents ofbdata
。
bdata
bdata = 3.2759 26.4660 3.4483 31.4461 3.6207 37.3633 3.7931 44.3940 3.9655 52.7475 4.1379 62.679 62.6730 4.3103 74.4662
刷牙删除数据值
使用上下文菜单从图表中删除图表。首先,绘制一些X
andy
值。打开刷牙,然后标记一些数据值。
x = linspace(0,5,30);y = exp(x);散射(x,y)刷('上')
要从图表中删除拉丝数据,请右键单击拉丝数据值,然后选择消除从上下文菜单。
Limitations
使用上下文菜单更改刷子标记的颜色,不支持使用该图创建的数字金宝appuifigure
功能。相反,创建一个刷子模式对象,然后编程更改其颜色。
uif = uifigure;ax = axes(uif);bar(ax,1:10)b =刷子(UIF);b.Color ='G';b.enable ='上';
更多关于
数据链接如何影响数据刷牙
随着绘制变量的变化,数据链接的数据会自动更新数字。使用命令启用数据链接linkdata on
。在链接图上创建的刷子标记将出现在显示相同变量的其他链接图上。即使其他地块不在刷牙模式下,也会发生这种情况。
When you turn on data linking for a figure, existing brush marks are replaced by the marks in other linked figures. If you turn on data linking and there are no other linked figures, then existing brush marks disappear. If you brush a graph and then turn off data linking, the brush marks remain.
适用以下条件:
Brush marks appear in the same color in all linked charts. The brush color that displays in linked charts is the brush color associated with the graph you are brushing.
链接变量不得复杂。您可以刷刷复杂的数据值,但是刷子标记不会出现在其他链接图表中。有关链接复杂变量的更多信息,请参见
linkdata
。
当表面图具有链接数据时,表面图上的刷子标记显示出不同的显示。当您刷一张链接的表面图表时,所有面都与相同YDATA
are also brushed. This behavior allows you to investigate relationships between columns of data distributed among multiple rows. The following images illustrate the difference between brushing unlinked and linked surface charts.
提示
要刷直方图图表,您必须首先打开数据链接。
版本历史记录
matlab命令
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。金宝app
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
美洲
- AméricaLatina((Español)
- 加拿大(英语)
- 美国(英语)