概要
Homebrewでgnuplotを入れました.aquatermとかqtとかpdf使えるようにします.
ひとまず確認
$ brew info gnuplotでオプションを確認します.
--cairo
Build the Cairo based terminals
--latex
Build with LaTeX support
--nogd
Build without gd support
--nolua
Build without the lua/TikZ terminal
--pdf
Build the PDF terminal using pdflib-lite
--qt
Build the Qt4 terminal
--tests
Verify the build with make check (1 min)
--with-x
Build the X11 terminal
--without-aquaterm
Do not build AquaTerm support
--without-emacs
Do not build Emacs lisp files
--wx
Build the wxWidgets terminal using pango
--HEAD
install HEAD version
お好みで選択してください.今回は,--latex --pdf --qt --with-x --without-emacsにします.私はVim派です.
AquaTermの導入
こちらより,AquaTermの最新版を落とします.dmgの中にpkgがあるので,インストールします.
brew
$ brew install gnuplot --latex --pdf --qt --with-x --without-emacs
勝手にaquaterm使えるようになってます.
gnuplot-lua-tikz.styのリンクを作成
せっかく--latexオプションつけて入れたのに\usepackage{gnuplot-lua-tikz}するとLaTeX error: 'gnuplot-lua-tikz.sty' not foundとか言われるのでシンボリックリンクを貼ります.
sudo ln -s /usr/local/Cellar/gnuplot/4.6.5/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty /usr/local/texlive/texmf-local/tex/latex/gnuplot/
結果
-
gnuplotでset termと打てば,terminalを一覧できるので,入れたかったものが入っているか見ることができます. - デフォルトのterminalが
aquaになってて嫌であれば,~/.gnuplotにset term qtとか書いておけば好きなやつに変えられます. - terminalを
qtにしてsplotすると, マウスでグリグリできませんでした- というか,視点の移動がマウスポインタに勝手についてきます.
-
mを押せば視点の移動されなくなります.(マウスのon/offを切り替えるコマンドなので) - 使えるコマンドは
hで出ます. - x11でもマウスでグリグリできなかった.
マウスでグリグリさせるやり方知ってたら教えて下さい
- terminalを
pdfにすると,plotを続けるとpdfの次のページにプロットされます.
test.gnuplot
set term pdf
set output "sample.pdf"
plot sin(x)
plot cos(x)
plot tan(x)
