Save GUI axes .jpg (cut-off)

6 ビュー (過去 30 日間)
Manuel
Manuel 2013 年 9 月 3 日
I have a GUI which contains an axes('Graph1_axes') and I would like to save it in jpg fromat and with the legends. Right now Im using the next code:
newfig1 = figure('Visible','off');
copyobj(handles.Graph1_axes, newfig1);
saveDataName = fullfile(path1,filename1);
saveas(newfig1,saveDataName,'jpg');
where 'Graph1_axes' is the axes to save, 'path1' where to save and 'filename1' the name of the file, the problem is that is saving the graph but without the legends and cuting-off the graph.
Thanks in advance!

回答 (1 件)

David Sanchez
David Sanchez 2013 年 9 月 3 日
Use print instead:
print('-dpng',your_fig_name);
or in jpg format:
print('-djpeg',your_fig_name);
  1 件のコメント
Manuel
Manuel 2013 年 9 月 3 日
Im not sure if im using it in the correct way but its not working:
newfig1 = figure('Visible','off');
copyobj(handles.Graph1_axes, newfig1);
new = print('-djpeg',newfig1);
saveDataName = fullfile(path1,filename1);
saveas(new,saveDataName,'jpeg');
Could you correct me, please?

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by