使用 gnuplot 生成 Latex 绘图的推荐工作流程?

发布于 2024-10-20 16:48:01 字数 205 浏览 2 评论 0原文

我有想要生成并包含在乳胶中的绘图。我正在使用 dvi -> pdf排版路径。 Gnuplot 提供输出“终端”epslatex、pslatex、pstex、pstricks、texdraw 等...

我认为其中之一比使用 svg“终端”并使用 inkscape 手动转换为 eps 更好,但我不知道在哪里开始。如果您的解决方案允许我在轴标签中包含乳胶数学表达式,那就太好了。

I have plots I want to generate and include in latex. I'm using the dvi -> pdf typesetting path. Gnuplot provides output "terminals" epslatex, pslatex, pstex, pstricks, texdraw, etc...

I presume one of these is better than using the svg "terminal" and converting to eps manually with inkscape, but I don't know where to start. Kudos if your solution lets me include latex math expressions in my axis labels.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独岁月 2024-10-27 16:48:01

导出到 SVG 没问题,特别是如果您打算稍后使用 Inkscape 手动增强绘图的外观。 Inkscape 有一个名为 textext 的插件,可以让你引入 LaTeX,非常有用。以下是使用 Gnuplot 生成并随后使用 Inkscape+textext 修改的曲线示例:
在此处输入图像描述

最近,我对 Gnuplot 的 TikZ 终端的结果非常满意(请参阅 这里有一些示例)。据我所知,此功能目前仅在 CVS 版本的 Gnuplot 中可用 并且完全值得您自己编译它。

下面是一个使用 Gnuplot 的 TikZ 终端的现成示例,它应该生成一个 tex 文件以及所需的样式文件:

set terminal push
set terminal lua tikz fulldoc createstyle
set output 'sin.tex'
plot sin(x)
unset output
set terminal pop

Exporting to SVG is fine, specially if you plan on manually enhancing the appearance of the plot later with Inkscape. There's a plugin for Inkscape that allows you to introduce LaTeX called textext that is very useful. The following is an example of a curve produced with Gnuplot and later modified with Inkscape+textext:
enter image description here

Lately, I have been very happy with the outcome of Gnuplot's TikZ terminal (see some examples here). This is a feature that as far as I know is only available for the moment in the CVS version of Gnuplot and it is totally worth the effort of compiling it yourself.

Here is a ready to use example of using Gnuplot's TikZ terminal that ought to produce a tex file together with the required style files:

set terminal push
set terminal lua tikz fulldoc createstyle
set output 'sin.tex'
plot sin(x)
unset output
set terminal pop
¢好甜 2024-10-27 16:48:01

我会谨慎使用乳胶端子。当然,他们的结果非常好,但根据您想要绘制的数据大小和发出的 Latex 命令数量,这可能会大大减慢 LaTeX 文档的编译时间。

如果可能的话,我会将绘图导出到 eps 或其他矢量文件中,并将其包含在您的 LaTeX 文档中。

另一方面,如果您想在绘图中包含一些只有 LaTeX 提供的奇怪功能(在您使用 gnuplot 绘制它们之后),那么这就是正确的方法。

I would be cautious to use latex terminals. For sure, their results are very good, but depending on the size of data you want to plot and the amount of latex commands issued this could slow down the compilation time of your LaTeX document quite a lot.

If it is possible for you, I would export the plot into an eps or other vector file and include that in your LaTeX document.

On the other hand, if you want to include some freaky features in your plots that only LaTeX offers (after you plotted them with gnuplot), than this is the way to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文