how to plot in UIAxes in app designer

i have written codes for a plot in .m file now i wanna plot the same thing in a interface made by using appdesigner.
this is my plotCapture1.PNG
i want to plot it here
Capture3.PNG

 Akzeptierte Antwort

Ajay Kumar
Ajay Kumar am 25 Okt. 2019
Bearbeitet: Ajay Kumar am 25 Okt. 2019

2 Stimmen

You can give axes handle in the plot.
for example, if you used
plot(x,y);
now, use
plot(app.UIAxes,x,y);
and ofcourse, the testtesttest function should have the handles of app.

10 Kommentare

Ni2
Ni2 am 25 Okt. 2019
Bearbeitet: Ni2 am 25 Okt. 2019
What is handles of app??
I dnt think i have them
My problem is my plot comes in 2D
View[1 1 1] is not working And same window is poping two times in one run. One with blank plot and one with 2D plot.
Ajay Kumar
Ajay Kumar am 25 Okt. 2019
Are you calling the testtesttest.m from app designer?
Ni2
Ni2 am 25 Okt. 2019
No i m not calling testesttest.m from app designer.
I an writing the testtesttest.m codes into the app designer
Please check my new post.
Mudasir JAMIL
Mudasir JAMIL am 5 Mai 2020
Hi Ajay, I am trying to display an image in the Axes with 'imshow(I)' command where I contains my image.
Can you kindly tell me the command to use. I am using Matlab 2019.
it works when I use plot(app.UIAxes,x,y) but I dont understand how to use 'imshow'.
I have watched several videos but nothing helped.
Waiting for your reply.
Thanks
Try this
imshow(I,'Parent',app.UIAxes);
Mudasir JAMIL
Mudasir JAMIL am 6 Mai 2020
Thank you very much, it worked
Eric Sargent
Eric Sargent am 9 Dez. 2020
Bearbeitet: Eric Sargent am 9 Dez. 2020
Ni2, you can find the handle of the axes in the Component Browser in App Designer. By default, the first one will be named "app.UIAxes" and subsequent ones will be "app.UIAxes_2" and so on. You can change the handle / name of the axes by double-clicking the name in the Component Browswer and entering a new name.
Aishwarya Lakshmi Srinivasan
Bearbeitet: Aishwarya Lakshmi Srinivasan am 1 Mär. 2021
Hi @Ajay Kumar. I am trying to display a figure from a .m file in the app (3D plot) using imshow(I,'Parent',app.UIAxes);
But I get an error of undefined variable of function for I when I try to run the app. Can you please suggest what can be done !
code in xyz.m file --> plotReadData=figure;
code in .mlapp file --> run xyz.m;
imshow(plotReadData, 'Parent', app.UIAxes);
Deyan Prashna
Deyan Prashna am 29 Apr. 2022
Based on the experience I've tried and succeeded, try typing this:
imshow(picture.jpg,'Parent',app.UIaxes)
For the picture format, it can be other than .jpg., and pay attention to the field name of the UI Axes used.
Hope it helps ^_^
Biraj Khanal
Biraj Khanal am 9 Jun. 2022
How do you use fnplt for uiaxes?
plot(app.uiaxes,x,y) works but fnplt(app.uiaxes,cscvn(points)) does not. Does anyone have any suggestion?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Gefragt:

Ni2
am 25 Okt. 2019

Kommentiert:

am 9 Jun. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by