The types of charts your app can support depend largely on the kind of figure that underlies
the UI. Apps you create using GUIDE and apps you create programmatically using the
uicontrol function use traditional figures and axes. These apps support all
of the graphics functionality available in MATLAB®.
Apps you create using App Designer are based on a new kind of figure, called a UI figure. To display graphics in these apps, you must use a new type of axes, called UI axes.
UI figures and UI axes are similar to traditional figures and axes, but there are some important differences to be aware of when deciding how to build your app.
Starting in R2017b, UI figures and UI axes support the following functionality:
All other functions that have been supported since R2017a. See Graphics Support in App Designer (R2016a - R2017a) for the full list.
However, the following functionality is not supported:
Any function listed in the table below
|Category||Functions Not Supported|
|Charting and Animation|
|Annotations and Colormap Adjustments|
|Retrieving and Saving Data|
See Graphics Support in App Designer (R2016a - R2017a) for a list of graphics functions supported in earlier releases.
In general, when you call a function within App Designer that accepts a target axes or
figure, you must specify that argument as the UI axes or UI figure. Otherwise,
gca is the
gca cannot return UI
figures and UI axes, so omitting them might lead to unexpected results.
plot(app.UIAxes,[1 2 3 4],'-r'); hold(app.UIAxes); plot(app.UIAxes,[10 9 4 7],'--b');
Searching for objects also requires the target input argument. This code finds a
UIAxes object whose
[0 1]. The search begins with the
Figure object specified as
ax = findobj(app.UIFigure,'XLim',[0 1]);
If you are moving code you wrote in previous releases into App Designer, you might encounter these limitations:
UI figures support a subset of the properties that traditional figures support. For example, UI figures do not support properties for printing, saving, or custom mouse and keyboard interaction. For a full list of supported properties, see UI Figure Properties.
UI axes support a subset of the properties that traditional axes support. For example, UI axes do not support properties for interactive control. For a full list of supported properties, see UIAxes Properties.
UI figures support a different set of interactive components than traditional figures do. For
example, UI figures do not support components created with the
uitoolbar functions. For a
full list of supported components, see Components in App Designer.
Some components support a subset of properties when you place them in UI figures. For example,
Table UI components do not support the
Extent property in UI figures. For a list of supported
properties for a particular component, see its property page on Components in App Designer.