Where are you intending to use the eps file? Also, can you try a different viewer, it may be a problem with the way your viewer is rendering the eps file.
Why do all text in figures move when saving as eps?
2 ビュー (過去 30 日間)
古いコメントを表示
xlabels move to the left, ylabels move down, titles move to the left. If I use, for example:
text(0.5,0.95,'12 V','units','normalized','horizontalalignment','center')
then '12 V' will appear centered in the plot, near the top, as it should. After saving, however, it will have shifted slightly to the left.
Perhaps the "center" is recalculated as the center of the entire figure rather than just the center of the plot. (EDIT: This cannot be entirely true because the longer the text is, the more it moves.)
I have tried saving with print(gcf,'-depsc','figname') and hgexport(gcf,'figname') as well as just using the Export option in the Plot Tools window, but in all cases the same thing happens.
I read somewhere that there is a bug with the legends if you use set PaperPosition, because it changes the PaperPositionMode from auto to manual. I have tried setting it to auto and I have tried restarting Matlab and saving figures without ever setting the PaperPosition, since apparently 'auto' should be the default mode. Still, the same thing happens.
The attached figure shows an example generated with the command sequence:
>> plot([1 2], [1 2])
>> grid on
>> text(0.5,0.95,'test text test text','units','normalized','HorizontalAlignment','center')
>> title('test title test title test title')
>> xlabel('xlabel (units)')
>> ylabel('ylabel (units)')
>> legend('legend','location','northwest')
and exported from the Plot Tools window.
This is all when I save the figures as eps files. The problem does not arise if I use png instead.
The Matlab version I use is R2018a for Linux (64-bit Debian).
EDIT: I don't get this problem using SVG instead of EPS. However, I've seen people saying "SVG was designed for the web while EPS is intended for print" and I'm working on something that's not for the web but will be printed. Also, I'm using LaTeX which does not natively support SVG.
6 件のコメント
Ameer Hamza
2018 年 4 月 25 日
If you have some doubt about the rendering of eps on Linux, you can try an online viewer. It might be some bug with the MATLAB on Debian.
回答 (1 件)
phnerd
2018 年 4 月 12 日
this figure can be saved as emf. what's the different between this two kinds of format?
参考
カテゴリ
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!