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

 Respuesta aceptada

Ajay Kumar
Ajay Kumar el 25 de Oct. de 2019
Editada: Ajay Kumar el 25 de Oct. de 2019
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 comentarios

Ni2
Ni2 el 25 de Oct. de 2019
Editada: Ni2 el 25 de Oct. de 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 el 25 de Oct. de 2019
Are you calling the testtesttest.m from app designer?
Ni2
Ni2 el 25 de Oct. de 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 el 5 de Mayo de 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 el 6 de Mayo de 2020
Thank you very much, it worked
Eric Sargent
Eric Sargent el 9 de Dic. de 2020
Editada: Eric Sargent el 9 de Dic. de 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
Aishwarya Lakshmi Srinivasan el 1 de Mzo. de 2021
Editada: Aishwarya Lakshmi Srinivasan el 1 de Mzo. de 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 el 29 de Abr. de 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 el 9 de Jun. de 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?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Preguntada:

Ni2
el 25 de Oct. de 2019

Comentada:

el 9 de Jun. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by