Save figure from GUI with axes and colorbar
1 次查看(过去 30 天)
显示 更早的评论
I am trying to save a figure from a GUI I made. However, I have tried several methods using code from this forum. Unfortunately, I can't get any of them to keep the axes, colorbar, and colormap of the original plot. Here is the code I am using:
[filename,pathname] = uiputfile('default','Save your GUI settings');
if pathname == 0 %if the user pressed cancelled, then we exit this callback
return
end
saveDataName = fullfile(pathname,filename);
F=getframe(handles.axes1);
figure();
image(F.cdata);
saveas(gcf,saveDataName,'fig')
thank you for your help!
0 个评论
采纳的回答
Image Analyst
2012-4-19
2 个评论
Image Analyst
2012-4-20
I don't know why. It works fine for me, and thousands of others (it's the most downloaded File Exchange file of all). You can show your code if you want us to fix it. Maybe you got the filename wrong or something. Or contact Oliver and ask him.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!