How to save a *.fig with the legend included?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
My question is quite simple :
I have the following code :
figure;
A = loglog(...)
hold on
B = loglog(...)
C = loglog(...)
str = sprintf('3SRS - Run %d - Dir %d', run, dir);
title(str);
xlabel('Fréquences [Hz]');
ylabel('Accel (G)');
legend( [A B C], '...','...','...' );
filename = str;
saveas(figure(1),filename,'fig');
close figure 1
And it appears that the figure is correctly saved in .fig but the legend isn't displayed when i open the saved *.fig
Thanks in advance. O.G.
2 件のコメント
回答 (3 件)
Artur M. G. Lourenço
2013 年 5 月 26 日
Try this,
figure;
A = loglog(1:50)
hold on
B = loglog(1:50)
C = loglog(1:50)
str = sprintf('3SRS - Run %d - Dir %d');
title(str);
xlabel('Fréquences [Hz]');
ylabel('Accel (G)');
legend( [A B C], 'Test A','Test B','Test C' );
filename = str;
saveas(figure(1),filename,'fig');
close figure 1
Image Analyst
2013 年 5 月 26 日
2 件のコメント
Image Analyst
2013 年 5 月 26 日
export_fig (the most downloaded file from the File Exchange, and recommended by the FAQ) will save the entire figure or axes. I'd be surprised if saved everything except the legend.
Adam Neuf
2015 年 5 月 21 日
I'm having the same problem, have you found the solution to fix this?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Printing and Saving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!