从 Matlab 输出具有全图的高分辨率图形

Output high-resolution figure from Matlab with full picture

我想从 Matlab 输出高分辨率图形。 我试着 "save as pic.eps"。但是当我在latex中插入这张图片时,在我可以看出分辨率不够的意义上,图片似乎不是"real eps"。 我也试过"save as pic.pdf"。分辨率满足我的要求,但是图片太大了,所以被裁剪了。

然后我用了

 print -depsc -tiff -r300 -painters pic.eps 

这给了我高分辨率的全图,但原图中的一些虚线消失了。我尝试了许多其他案例,但仍然找不到解决问题的正确方法。非常感谢任何建议

我会尝试将 eps 保存为 vector 格式,或者使用仅矢量格式,例如 .svg.

例如,

print -depsc2 -painters test.eps

根据当前文档,这些是矢量图形支持的格式:

Option      Vector Graphics Format                                  File Extension
'-dpdf'     Full page Portable Document Format (PDF) color          .pdf
'-deps'     Encapsulated PostScript (EPS) Level 3 black and white   .eps
'-depsc'    Encapsulated PostScript (EPS) Level 3 color             .eps
'-deps2'    Encapsulated PostScript (EPS) Level 2 black and white   .eps
'-depsc2'   Encapsulated PostScript (EPS) Level 2 color             .eps
'-dmeta'    Enhanced Metafile (Windows® only)                       .emf
'-dsvg'     SVG (Scalable Vector Graphics)                          .svg
'-dps'      Full-page PostScript (PS) Level 3 black and white       .ps
'-dpsc'     Full-page PostScript (PS) Level 3 color                 .ps
'-dps2'     Full-page PostScript (PS) Level 2 black and white       .ps
'-dpsc2'    Full-page PostScript (PS) Level 2 color                 .ps

您还必须在保存矢量图形文件时使用 '-painters' 渲染器。如果您保存到矢量图形文件并且图窗 RendererMode 属性 设置为 'auto',则打印会自动尝试使用 Painters 渲染器。如果要确保输出格式是真正的矢量图形文件,请指定 Painters 渲染器。例如:

 print('-painters','-deps','myVectorFile')

这个有问题的命令可能来自以下link

删除 -tiff 后,我漏掉一行的问题得到解决(尽管我不明白“-tiff”是干什么用的)