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

 채택된 답변

Ajay Kumar
Ajay Kumar 2019년 10월 25일
편집: Ajay Kumar 2019년 10월 25일

2 개 추천

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

Ni2
Ni2 2019년 10월 25일
편집: Ni2 2019년 10월 25일
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 2019년 10월 25일
Are you calling the testtesttest.m from app designer?
Ni2
Ni2 2019년 10월 25일
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 2020년 5월 5일
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 2020년 5월 6일
Thank you very much, it worked
Eric Sargent
Eric Sargent 2020년 12월 9일
편집: Eric Sargent 2020년 12월 9일
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 2021년 3월 1일
편집: Aishwarya Lakshmi Srinivasan 2021년 3월 1일
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 2022년 4월 29일
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 2022년 6월 9일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

Ni2
2019년 10월 25일

댓글:

2022년 6월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by