Graphics Object Properties
You can control the behavior and appearance of a particular graphics object by setting
its properties. To set properties, return the object as an output argument from the function
that creates it. For example, the plot
function returns a chart line
object. Then, use dot notation to view and set properties.
p = plot(1:10,1:10); p.LineWidth = 3;
plot(1:10,1:10,'LineWidth',3)
. Most plotting functions support name-value
pair arguments.
Properties
Functions
get | Query graphics object properties |
set | Set graphics object properties |
reset | Reset graphics object properties |
Property Inspector | Open property inspector |
Topics
- Modify Graphics Objects
This example shows how to create, display, and modify graphics objects in MATLAB®.
- Graphics Object Hierarchy
Graphics objects are the visual components used by MATLAB® to display data graphically.
- Access Property Values
You can set and query property values or return them to their original (factory default) values.
- Default Property Values
Nearly all graphics object properties have predefined values, but you can define default property values.
- Multilevel Default 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
Plotting functions use factory-defined property values if you do not specify values as arguments or as defaults.
- DPI-Aware Behavior in MATLAB
Learn about DPI-aware behavior that improves the appearance of graphical elements on high-resolution systems.