plot in UIAxes from a matlab function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Marco Picillo
el 30 de Mzo. de 2021
Comentada: Marco Picillo
el 31 de Mzo. de 2021
Hi, i created a function in matlab that plots a graph giving some inputs. i want to put this function in my GUI and show the graph in the GUI. How can i do that?
At this moment the function runs in the GUI, but the plot it's shown in a figure, not in the UIFigure, how can i fix this problem?
thank you!
0 comentarios
Respuesta aceptada
Adam Danz
el 30 de Mzo. de 2021
5 comentarios
Adam Danz
el 31 de Mzo. de 2021
I see that this is a plotting function.
It is good practice to include a parent handle in the inputs of plotting functions so that all internal plotting commands can act on the specified axes/figure/etc.
For example,
function plotsomething(inp1,inp2,axisHandle)
fill3(axisHandle, . . .)
set(axisHandle, . . .);
view(axisHandle, . . .);
axis(axisHandle, 'equal');
hold(axisHandle, on)
xlabel(axisHandle,'x-coordinate')
% etc....
end
Then call the function from your app using,
plotsomething(x,y,app.UIAxes) % except use YOUR axis handle!
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!