Gnuplot TikZ 终端

3

如何在Mac Os X(10.6.8)上启用gnuplot中的tikz终端?

我已经安装了具有工作tikz的latex。现在我从http://www.lua.org/下载了lua并下载了gnuplot4.4.4,解压缩后运行:

$ ./configure
$ sudo make
$ sudo make install

现在我已经设置了tikz终端,但仍然存在问题。
gnuplot> set terminal tikz
Terminal type set to 'tikz'
Options are 'color dashed'
gnuplot> plot sin(x)
\begin{tikzpicture}[gnuplot]
         /usr/local/share/gnuplot/4.4/lua/gnuplot-tikz.lua:252: bad argument #7 to 'format' (string expected, got no value)
stack

gnuplot> 

我也尝试从https://github.com/mxcl/homebrew/wiki/installation安装homebrew,尽管我没有进行Java Developer Update - 这是必要的吗? 现在'brew install gnuplot'在glib依赖方面存在问题。

hpek@melda:~$ brew install glib
/usr/local/Library/Homebrew/global.rb:43: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/usr/local/bin/brew:74: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/usr/local/Library/Homebrew/build.rb:7: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
==> Downloading ftp://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.8.tar.bz2
File already downloaded in /Users/hpek/Library/Caches/Homebrew
==> Downloading patches

curl: (22) The requested URL returned error: 404
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
/usr/bin/patch: **** Can't open patch file 001-homebrew.diff : No such file or directory
Error: Failure while executing: /usr/bin/patch -f -p0 -i 001-homebrew.diff
hpek@melda:~$ 

当我手动安装gnuplot时,我是否需要自己了解并安装所有这些依赖项?

你的系统上是否安装了latex和tikz?你是否检查了./configure的输出,以查看它是否解释了为什么无法启用tikz终端? - James
是的,我有安装了MacTeX,并且TikZ也在正常工作。我只在config.log文件中看到了这一行与TikZ相关的信息。 - hpekristiansen
你尝试在日志中使用grep查找lua了吗?我认为你需要安装lua及其开发头文件。 - James
我认为你是正确的 - 有16行带有单词lua,例如ld: library not found for -llua。Lua是什么,我该在哪里获取它? - hpekristiansen
我现在已经完全重写了我的问题,以反映我的进展。 - hpekristiansen
2个回答

1
问题在于LUA脚本中的252(或我的版本中的254)使用了比必要参数更少的格式命令。将“X”作为第5个参数(又名脚本修订号)添加即可解决此问题。
以下是我在脚本中的新代码:
gp.write(string.format("%%%% generated with GNUPLOT %sp%s (%s; terminal rev. %s, script rev. %s)\n%%%% %s\n",
      term.gp_version, term.gp_patchlevel,
      string.sub(term.lua_term_revision,7,-3),"x",
      pgf.REVISION,os.date()))

如果我知道在哪里找到脚本修订号,那就更好了。


0

尝试:

brew update

然后再试一次。现在似乎已经修复了。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接