How to save the axes with xtick, ytick, legend and title in GUI?

1 回表示 (過去 30 日間)
QiQin Zhan
QiQin Zhan 2013 年 2 月 25 日
How to save the axes with xtick, ytick, legend and title in GUI?

回答 (2 件)

Image Analyst
Image Analyst 2013 年 2 月 25 日
Have you read the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions. It recommends export_fig() - the most downloaded of all File Exchange submissions.
  2 件のコメント
QiQin Zhan
QiQin Zhan 2013 年 2 月 25 日
The function 'exportfig()'can export a figure. But I want to save the axes in the GUI. Can you tell me how to do it?
QiQin Zhan
QiQin Zhan 2013 年 2 月 25 日
編集済み: QiQin Zhan 2013 年 2 月 25 日
If I generate some scatters on the axes,the code is
h = scatter(gca,X,Y,3,'k');
Then I use the code
axes(handles.axes_of_data);
export_fig(gca,'axes_of_data.jpg')
to save the axes,but unfortunately I find no scatters in the figure I saved.
However,when I change the code to
plot(X,Y);
Then I can save the figure with the lines plotted on the figure.
Why is so strange?How can I save the figure with the scatters?

サインインしてコメントする。


Sean de Wolski
Sean de Wolski 2013 年 2 月 25 日
What do you mean by "save the axes"? If you save the figure, all of the above information will be saved (see, doc hgsave and doc save)
If you want to only save the axes, then use copyobj to copy just the axes into a blank figure and save it.

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by