set

Sets property values for graphics handles.

Syntax

set(handle, p, v)

Inputs

handle
Graphics handle.
Type: char
Dimension: string
p
Property to be modified.
Type: string
Dimension: scalar
v
Value of property to be modified.
Type: double | char | logical | struct | cell | integer
Dimension: scalar | vector | matrix

Example

Simple set example:

clf;
titleHandle = get(gca, 'title')
set(titleHandle, 'string', 'dummy title')
set(titleHandle, 'color', [255 0 0])


Comments

Set can be used to set properties of different graphics objects, including root figure, axes, line, text, surface. Each type of graphics object has its own properties:

Root's properties:
children (read only): Child objects of the root.
currentfigure: Current active figure.
handle (read only): Handle of the root, always 0.
parent (read only): Handle of the parent of the root, always empty.
type (read only): Type of the graphics object, which is always 'root'.
Figure's properties:
children (read only): Child objects of the figure.
currentaxes: Current active axes in the figure.
handle (read only): Handle of the figure.
parent (read only): Handle of the parent of the figure, which is always the root's handle 0.
type (read only): Type of the graphics object, which is always 'figure'.
visible: Visibility of the figure.
Axes' properties:
children (read only): Child objects of the axes.
color: Background color of the axes.
handle (read only): Handle of the axes.
parent (read only): Handle of the parent of the axes.
title: Handle of the title of the axes.
type (read only): Type of the graphics object, which is always 'axes'.
visible: Visibility of the axes.
xcolor: Color of x axis.
xlabel: Handle of the x axis label.
xminorgrid: Visibility of x axis grid.
xscale: Scale type of x axis.
ycolor: Color of y axis.
ylabel: Handle of the y axis label.
yminorgrid: Visibility of y axis grid.
yscale: Scale type of y axis.
zcolor: Color of z axis.
zlabel: Handle of the z axis label.
zminorgrid: Visibility of z axis grid.
zscale: Scale type of z axis.
Line's properties:
children (read only): Child objects of the line.
color: Color of the line.
handle (read only): Handle of the line.
linestyle: Style of the line.
linewidth: Width of the line.
marker: Style of the marker on the line.
markerfacecolor: Color of the marker on the line.
parent (read only): Handle of the parent of the line.
type (read only): Type of the graphics object, which is always 'line'.
Surface's properties:
children (read only): Child objects of the surface.
handle (read only): Handle of the surface.
parent (read only): Handle of the parent of the surface.
type (read only): Type of the graphics object, which is always 'surface'.
Text's properties:
children (read only): Child objects of the line.
color: Color of the text.
fontangle: Font angle of the text, either regular or italic.
fontname: Font family of the text.
fontsize: Font size of the text.
fontweight: Font weight of the text, either normal or bold.
handle (read only): Handle of the text;
parent (read only): Handle of the parent of the line.
string: Displayed text.
type (read only): Type of the graphics object, which is always 'text'.
visible: Visibility of the text.