MATLAB: App Designer: plot on Axes out of function

app designeraxescurrent axesfigurefilefunctionguiMATLABplot

Hi everyone,
I created a GUI in App Designer with an Axes-Object on it. Now I want to enter some values via different buutons/slider etc., calculate some stuff and then plot my results on this Axes-Object.
I made a function as m-file which I call to draw/plot all the stuff I want. This is how I call the function:
drawFunction(Data, app.Axes);
In drawFunction I call
function drawFunction(Data, Axes)
axes(Axes)
... % plot stuff
But all the plots I call are drawn to a new figure which opens and not to my Axes on the GUI. Where is my mistake?

Best Answer

In App Designer, those are uiaxes.
In the plot function, you can specify axes to plot to
plot(Axes, 1, 1, 'kd')