How can I save plots in GUI ?
Afficher commentaires plus anciens
Hi. I am currently working on embeding a plot in GUI. I want to see the plot inside the gui interface not in the figure box. I achieved to embed the figure into the interface but when I also want to save it by saveas the image i get turns out to be depending on the position of the axes in the gui workspace. I mean if I slide axes trough the edges of the workspace I get no image or if I approach it to the edges I might get half of the plot from the file where the plot is saved. The following code does what I provided above. All help that you are going to provide is well appreciated.
"""""
function pushbutton1_Callback(hObject, eventdata, handles)
axes(handles.axes1);
box(gca,'on');
A=[1 2 3 4 5 6];
B=[0 1 0 -1 0 1];
plot(A,B)
saveas(gcf,['STEP' num2str(1+9999) '.png'],'png');
""""""
1 commentaire
Ragunanth Venkatesh
le 2 Août 2017
fh = figure;
copyobj(handles.axes1, fh);
just use this and then u will open the figure from the gui as a seperate figure, and then you can save it using save as.
Réponses (0)
Catégories
En savoir plus sur Data Exploration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!