matlab 将绘图导出为矢量格式 [英] matlab export plot to vector format

查看:23
本文介绍了matlab 将绘图导出为矢量格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前我一直以光栅格式(JPG、PNG)导出 Matlab 图形

All the time previously I was exporting Matlab figures in a raster format (JPG, PNG)

有没有办法以矢量格式 (SVG) 从 Matlab 导出绘图.我需要它来将绘图插入到 LaTeX 文档中.

Is there a way to export a plot from Matlab in a vector format (SVG). I need it to inset that plots into LaTeX document.

到目前为止,我发现唯一的一个插件来自 mathworksstackexchangestackexchange ,但这看起来太复杂了

The only thing, I have found so far is a plugin from mathworks and the answer from stackexchange , but this looks rather too complicated

推荐答案

还有matlab2tikzmatlabfrag 导出到 eps 并带有用于导入 LaTeX 的注释.

There is also matlab2tikz and matlabfrag which exports to eps with annotation for importing to LaTeX.

这里是我使用 matlabfrag 的一个例子.

Here is an example of mine where I've used matlabfrag.

我还与 Mathworks 工程师讨论过这个问题,他同意这种事情没有一个很好的工具,因为每个人都想用它做不同的事情(我已经提到了两种不同的 LaTeX 方法).所以 imo 最好的办法是使用不同的工具,看看哪个最适合你.

I've also discussed this with a Mathworks engineer, who agreed that there is not a nice-and-ready tool for this kind of thing, because everybody wants to do different things with it (I already mention two different LaTeX approaches). So imo the best thing to do is to play around with different tools and see which suits you best.

大多数时候,我不得不对坐标轴、标签的字体大小等进行大量修改,才能得到我想要的(顺便说一句,调整图例是最大的地狱).

Most of the times I had to tinker a lot with the axes, font size of labels, etc to get it exactly how I wanted (btw adjusting a legend is the greatest hell).

这篇关于matlab 将绘图导出为矢量格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆