MATLAB: Saving an axes as jpg file using saveas

guidejpeg

Hallo All
I have been trying to save an axes object on an gui as jpg file but it takes up weird pictures, like sometime the photo has only the centre part of the axes and sometimes it doesn't save the picture of the axes at all instead it takes picture of the pushbuttons besides the axes (in the GUI). Have been trying to set this error for a long time.
Thanks a lot.

Best Answer

F = getframe(handles.axes1);
Image = frame2im(F);
imwrite(Image, 'Image.jpg')
Related Question