【问题标题】:Insert an eps image within gnuplot?在gnuplot中插入eps图像?
【发布时间】:2014-12-10 13:25:09
【问题描述】:

我想用 gnuplot 绘制一些数据,但我想添加与数据源相关的图像,而不是使用常规键(或图例)。例如,假设我正在绘制 iOS 与 Android 的一些数据,并且我想将徽标而不是名称添加到键中。该图随后将包含在 LaTeX 文档中。我的脚本与此类似。

#!/usr/bin/gnuplot -persist
set terminal epslatex size 6in,4in color dashed
set output 'apple-vs-android.tex'
set key bottom spacing 2 maxrows 1 width 8 at first 2000,175

set tics out mirror
unset x2tics
unset y2tics
set xlabel 'Year'
set ylabel 'Users'

plot "apple.dat"   u 1:2 w l        lt 1  lc 0 notitle smooth csplines,\
     "android.dat" u 1:2 w lp pt 12 lt 3  lc 0 notitle smooth csplines,\
     "apple.dat"   u 1:2 w p  pt 2        lc 0 notitle,\
     "android.dat" u 1:2 w p  pt 12       lc 0 notitle,\
     "apple-logo.png" binary filetype=png origin=(1960, 165) dx=1./10 dy=1./220000 with rgbimage notitle,\
     "android-logo.png" binary filetype=png origin=(1995, 165) dx=1./10 dy=1./220000 with rgbimage notitle,\
     -10 w lp pt 2  lt 1 lc 0 t " ",\
     -10 w lp pt 12 lt 3 lc 0 t " "

最后两行是唯一带有标题的条目(空),只是为了在键中添加一些内容,并且徽标将位于靠近它们的位置,以识别系列。脚本上的实际值(原点、dx、dy、关键位置)将取决于徽标图像的大小和绘制的数据。使用我的图像和数据,我调整了值,看起来不错。

问题是我有一个带有我的徽标的 SVG 图像。从中我可以创建矢量 EPS 而不是光栅 PNG。有什么方法可以在 gnuplot 中导入 EPS 图像,而无需手动编辑 EPS 代码和 gnuplot 使用 epslatex 终端生成的 .tex

谢谢

【问题讨论】:

  • 感谢您的评论。 \includegraphics 标签很聪明,也可以用于矢量图
  • 该方法与epslatex 一起使用几乎是唯一的方法(除了使用其他与TeX 相关的终端之外)使用gnuplot 包含矢量图形而无需后处理。

标签: import gnuplot eps


【解决方案1】:

gnuplot 不是图像处理程序,但有一些变通方法。有ways 通过multiplot 包含光栅图形。我的第二个链接中概述的方法(使用 epslatex 终端)也适用于 .eps 图形。

【讨论】:

  • 谢谢,我猜你的意思是第一个链接。多图允许更好地控制我使用的方法。谢谢你的提示。 \includegraphics 作为标签,发布在here 也非常聪明。这也不是我想要的,但可能我过度使用了 gnuplot 的功能。正如你所说,它不是一个图像处理程序
  • @phollox,我实际上是想链接到你提到的文章!我会更新我的答案。我认为\includegraphics 命令应该让您包含光栅或矢量图像。
猜你喜欢
  • 1970-01-01
  • 2021-07-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-01-06
  • 1970-01-01
  • 1970-01-01
  • 2011-01-29
相关资源
最近更新 更多