sinogyang的个人博客分享 http://blog.sciencenet.cn/u/sinogyang

博文

[转载]matlab保存eps为非矢量图的解决办法

已有 1892 次阅读 2022-5-16 15:14 |个人分类:Matlab|系统分类:科研笔记|文章来源:转载

省流:

set(gcf,'renderer','Painters');


**

引自: Why does MATLAB not export EPS files properly? - (mathworks.cn)


The renderer that MATLAB is using to display the images is very likely a bitmap renderer such as OpenGL or zbuffer (the figures you sent me used the ‘zbuffer’ renderer). EPS formats are essentially vector formats so it is best if the renderer that you use to generate the figure is also a vector renderer ('painters').

As you are likely using a bitmap renderer, MATLAB has to first convert the bitmap into a vector, and this conversion of bitmaps to vector images is often a time-consuming and inefficient process.

This is why your images appear incorrect when you print them.

SOLUTION:

1) Change the renderer of the figure before you draw your figure or before you export. You can use the following command:

ThemeCopy

>>set(gcf,'renderer','Painters')

2) Change the renderer used by the PRINT command. By default it uses the same renderer that the figure uses, so you would have to type the following command to over-ride this:

ThemeCopy

    >> print -depsc -tiff -r300 -painters <filename>.eps

or

ThemeCopy

  >> print -depsc2 -tiff -r300 -painters <filename>.eps

Also, I suggest you use a PostScript printer or viewer to view your EPS files. This is just to make sure that you are viewing your actual EPS file and not the TIFF preview.





https://wap.sciencenet.cn/blog-228329-1338787.html

上一篇:不经常上博客,有问题请发邮件,谢谢!
收藏 IP: 221.0.186.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-29 06:45

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部