图形对象属性
您可以通过设置其属性来控制特定图形对象的行为和外观。要设置属性,请从创建它的函数中返回对象作为输出参数。例如,plot
功能返回图表线对象。然后,使用点符号查看和设置属性。点表示法在R2014B及以后起作用。如果您正在使用较早的版本,请使用get
和set
函数。有关更多信息,请参阅Access Property Values。
p = plot(1:10,1:10); p.LineWidth = 3;
情节(1:10,1:10,'lineWidth',3)
。大多数绘制函数支持名称值对参数。万博1manbetx
Properties
Functions
get |
Query graphics object properties |
set |
设置图形对象属性 |
reset |
将图形对象属性重置为默认值 |
Property Inspector | 开放物业检查员 |
Topics
图形objects are the visual components used by MATLAB®to display data graphically.
You can set and query property values or return them to their original (factory default) values.
Features Controlled by Graphics Objects
图形对象以直观和有意义的方式表示数据,例如这些对象的线图,图像,文本和组合。
Nearly all graphics object properties have predefined values, but you can define default property values.
此示例显示了如何设置默认行样式。
This example sets default values on more than one level in the hierarchy.
Default Values for Automatically Calculated Properties
When you create a graph, MATLAB sets certain property values appropriately for the particular graph.
How MATLAB Finds Default Values
All graphics object properties have values built into MATLAB. You can also define your own default values.
Factory-Defined Property Values
绘制函数如果未将值指定为参数或默认值,则使用出厂定义的属性值。
Learn about DPI-aware behavior that improves the appearance of graphical elements on high-resolution systems.