Some issues about showing a plot in App Designer

Hi, I am new on Matlab and I am working on an app using App Designer.
When I run my app, the figure I would like to show in app.UIAxes doesn't work, and the figure is shown in an external box (like a normal script). My .m code for plot is
app.MYCLASSNAME=app.NAMEOFMYCLASS.CreateSeries('RANGE',{1,2,3});
app.MYCLASSNAME.PlotSc7('COMBITRANS');
pause(0.1)
legend([num2str(app.MYCLASSNAME.RANGE) 'm']);
How can I show the plot in the app interface?
Thank you for your help.

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 4 月 26 日

0 投票

When plotting in an app, you must specify the target axes.
So inside your class, your plot command might be
plot(app.UIAxes,x,y)
This tutorial app might help you get started.

2 件のコメント

Santina D'Urso
Santina D'Urso 2021 年 4 月 26 日
My problem is that I haven't x and y values but I have a function (which is PlotSc7) that create the desired plot. How can I call it using "plot(app.UIAxes, ....)"?
Cris LaPierre
Cris LaPierre 2021 年 4 月 26 日
How does your function PlotSc7 create a plot? If it's not using the plot function, what does it use?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

質問済み:

2021 年 4 月 26 日

コメント済み:

2021 年 4 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by