App Designer: How to plot graph from own function into UIAxess?

Hello,
I have a few functions of different cartographic projections together with orthodrome and loxodrome in individual scripts (function in m-file). The coordinates of the points of both curves are at the input. When I run the function, a graph window pops up.
In the App Designer, when I press the calculation button (výpočet), I would need to display the graph in UIAxess and not in a pop-up. I'm a new in App Designer and I don't know how to do it. Here is a sample:
In school we have a project, so sorry that the script is half in Czech.
Thank you for answer.

Answers (1)

if you look at the plot() function or any other display/plotting tools like imagesc(), image(), imshow(), etc... the first entry can be the target axis handle. so in app designer the default tag for the axes is app.UIAxes like in your commented out line plot(app.UIAXes,......) which tells plot to put the plot in the app.UIAXes. otherwise matlab appdesigner will open up a new figure. you can get the tag/name by looking at the design view and clicking on highlighted name.

4 Comments

I'm not sure if I understood your answer. I understand that by writing: plot(app.UIAxes, ..) the plot will not pop up. But I don't know how to add my function into this entry. The output of my function is a graph and not coordinates that I could enter in the plot (.., x, y).
Could you please be more specific on how I can solve this problem?
you'll have to look in the function azimut_gnomon and add it there. It doesn't look to be a built in matlab function that i can find so in that function it is plotting or adjust azimut_gnomon and have it return the values so you can plot it.
That's a problem. In each function of projection I have define various parallels and meridians. My functions give me everything I need:
My function gives me a plot of parallels, meridians, orthodromes and loxodromes - all this I need in UIAxes. So I can't change output to variables.Or Can I? What would it look like then?
Hello Anna,
Did you get the answer to your questionhttps://www.mathworks.com/matlabcentral/answers/1582494-app-designer-how-to-plot-graph-from-own-function-into-uiaxess#comment_1824219? I have tried so many ways so far but no solution. If you got it right, Kindly help. However, i am using the control chart function.
Thank you.

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Release

R2021a

Asked:

on 9 Nov 2021

Commented:

on 13 Dec 2022

Community Treasure Hunt

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

Start Hunting!