How to save a plot as an image with titles and x y lables

14 次查看(过去 30 天)
Yeah I want to save a plot I have on my GUI, with the title and axis labels on the image.
F = getframe(handles.axes2);
Image = frame2im(F);
imwrite(Image, 'Image.jpg')
This code saves what's on the axes on the GUI but it doesnt save any of the text around it.
any solutions?

回答(1 个)

Image Analyst
Image Analyst 2019-6-25
Click on the toolbar save icon (if you have the toolbar showing) or use File/SaveAs (if youhave the pulldown menu showing).
Or do it from code with export_fig
  2 个评论
Greg Morris
Greg Morris 2019-6-25
Well, something I've forgotton to mension is that there are GUI controls on the gui, so I can't just save the figure to export the image of just the plot and its labels. I apologize for not mentioning this earlier.
Image Analyst
Image Analyst 2019-6-25
You can still use export_fig or saveas() from the code. Make a pulldown menu or button to let the user do the save, and in the callback, call saveas() or export_fig().

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by