This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


(App Designer) Create circular, linear, ninety-degree, or semicircular gauge component

Use only with App Designer or figures created with the uifigure function. Apps created with GUIDE or the figure function do not support gauge components.


g = uigauge
g = uigauge(style)
g = uigauge(parent)
g = uigauge(parent,style)
g = uigauge(___,Name,Value)


g = uigauge creates a circular gauge in a new UI figure window and returns the Gauge object.

g = uigauge(style) specifies the gauge style.


g = uigauge(parent) creates the gauge in the specified parent container. The parent container can be a Figure created using the uifigure function, or one of its child containers: Tab, Panel, or ButtonGroup.


g = uigauge(parent,style) creates a gauge of the specified style in the specified parent container.


g = uigauge(___,Name,Value) specifies object properties using one or more Name,Value pair arguments. Use this option with any of the input argument combinations in the previous syntaxes.

Input Arguments

collapse all

Type of gauge, specified as any one of the following values:

StyleDefault Visual

Parent object, specified as a Figure created using the uifigure function, or one of its child containers: Tab, Panel, or ButtonGroup.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Each type of gauge supports a different set of properties. For a full list of properties and descriptions for each type, see the associated property page.


collapse all

fig = uifigure;
cg = uigauge(fig);

fig = uifigure;
lg  = uigauge(fig,'linear');

Specify a panel as the parent container for a linear gauge.

fig = uifigure;
pnl = uipanel(fig);
lg = uigauge(pnl,'linear');

Create a circular gauge, and set the ScaleDirection property to specify that the needle moves counterclockwise.

fig = uifigure;
cg = uigauge(fig,'ScaleDirection','counterclockwise');

Change the number of major ticks, specify matching tick labels, and remove minor ticks.

cg.MajorTicks = [0:10:100];
cg.MajorTickLabels = {'0','10','20','30','40','50','60','70','80','90','100'};
cg.MinorTicks = [];

fig = uifigure;
cg = uigauge(fig,'ScaleColors',{'yellow','red'},...
                 'ScaleColorLimits', [60 80; 80 100]);

Introduced in R2016a

Was this topic helpful?