LoginSignup
33
31

More than 5 years have passed since last update.

Homebrewでgnuplotを入れる

Last updated at Posted at 2014-06-14

概要

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/

結果

  • gnuplotset termと打てば,terminalを一覧できるので,入れたかったものが入っているか見ることができます.
  • デフォルトのterminalがaquaになってて嫌であれば,~/.gnuplotset 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)

スクリーンショット 2014-06-15 1.47.09.png

33
31
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
33
31