App Designer: plot on Axes out of function
3 次查看(过去 30 天)
显示 更早的评论
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?
1 个评论
Mohammad Sami
2020-10-7
Maybe its the line
axes(Axes).
You can directly specify the axes to plot in most plotting functions as the first argument.
plot(Axes,1:10,1:10);
采纳的回答
Mario Malic
2020-10-7
编辑:Mario Malic
2020-10-7
In App Designer, those are uiaxes.
In the plot function, you can specify axes to plot to
plot(Axes, 1, 1, 'kd')
6 个评论
Mario Malic
2020-10-8
编辑:Mario Malic
2020-10-8
I doubt so, gca does not accept uiaxes, you can replace your 'plot(' by 'plot(ax,' by using Find option (Ctrl+F).
This is worth of a question (if it's not asked already), so maybe someone else will have an idea how to do it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!