Default Values for Automatically Calculated Properties - MATLAB & Simulink (original) (raw)
Main Content
What Are Automatically Calculated Properties
When you create a graph, MATLABĀ® sets certain property values appropriately for the particular graph. These properties, such as those controlling axis limits, have an associated mode property.
The mode property determines if MATLAB calculates a value for the property (mode is auto
) or if the property uses a specified value (mode is manual
).
Default Values for Automatically Calculated Properties
Defining a default value for an automatically calculated property requires two steps:
- Define the property default value
- Define the default value of the mode property as
manual
Setting X-Axis Limits
Suppose you want to define default values for the x-axis limits. Because the axesXLim
property is usually automatically calculated, you must set the associated mode property (XLimMode
) tomanual
.
set(groot,'defaultAxesXLim',[0 8]) set(groot,'defaultAxesXLimMode','manual') plot(1:20)
The axes uses the default x-axis limits of [0 8]
: