Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Save a gui plot in a new file
Replies: 3   Last Post: Dec 17, 2012 8:10 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kristin

Posts: 67
Registered: 2/22/12
Re: Save a gui plot in a new file
Posted: Dec 7, 2012 8:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Mara " <mara.srosado@gmail.com> wrote in message <k9osf6$ohh$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> I need your help.
>
> I'm making a GUI with several push buttons and axes.
> By clicking in a push button, appears a graph in the axes.
>
> What I want to do is, by clicking in other push button, it saves the image in a new image file.
>
> This is what I have:
> --------------------------------------------------------------------------------------------------------------
> function [ output_args ] = gera_imagem (grafico_i)
>
> [ficheiro_nome3, directoria_nome3] = uiputfile('*.jpeg;*.tif;*.png;*.gif', 'Guardar a imagem:');
> nome3 = fullfile(directoria_nome3,ficheiro_nome3);
>
> saveas(grafico_i,nome3);
>
> end
> ---------------------------------------------------------------------------------------------------------------
>
> grafico_i is the plot that appears on GUI and that's what I want to save in the file named nome3..
>
> What that saveas do is to save a bit of the GUI menu, not the graph...
>
> How do I copy the graph that's created in the GUI to the new image file?
>
> Can you help please?
>
> Thanks a lot,
> Mara


When I've done this, I've made a new figure window and plot it in this new figure (or use COPYOBJ). Save this new figure window, then close it, as if nothing happened...

Or, you can grab the handles of the GUI-stuff (pushbuttons and whatnot) and hide them, then save the figure, then make them visible again.

set(uicontrol_handle, 'Visibility', 'off');



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.