FUNCTION REFERENCE

set

Change properties of graphics and audio objects.

Change properties of graphics and audio objects.

Syntax

set(h, 'PropertyName', value)

Syntax

set(h, 'Name1', value1, 'Name2', value2)

Audio players and recorders accept SampleRate while stopped, as well as Tag and UserData.

Up to 16 property and value pairs. Root defaults: set(0, 'Default<Type><Prop>', value) or set(groot, ...) sets session-wide defaults for newly created Figure, Axes, Line, Text, Patch, Surface, and Image objects (case-insensitive); pass 'remove' to restore the factory default or 'factory' to set the factory value. Figure-level defaults set(gcf, 'Default<Type><Prop>', value) apply to children created in that figure. Axes: XLim, YLim, XScale, YScale, XGrid, YGrid, NextPlot, FontSize, ColorOrder, Colormap, CLim and others. Figure: Name, Theme, ThemeMode, Color, Colormap, Visible. Lines: LineWidth, Visible, XData, YData. Titles and labels: String, Color. h.Prop = value is the same as set(h, 'Prop', value).

Example

plot(1:3); set(gca, 'XLim', [0 5]); get(gca, 'XLim')   % [0 5]

Example

set(0, 'DefaultAxesFontSize', 14); get(0, 'DefaultAxesFontSize')   % 14

Differences from MATLAB: Not checked against MATLAB yet. Unknown properties or values are rejected with an error. Call it as a statement.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.