Augmented Usamimi

it { is_expected.to be_blog.written_by(izumin5210) }

【gnuplot】ラベルに数式使ったり日本語使ったり…

Macgnuplotだとラベルに日本語使おうとしたら化けまくったりする.

そういうときはterminalをTikZ(てぃくす)というのにすると便利なんやで.

brewからインストールするときに--with-latexオプションを付与するだけ.

$ brew install gnuplot --with-latex --with-x11

プリアンブルにgnuplot-lua-tikz追加. *.styファイルはgnuplotインストールディレクトリからパクってくる.

\usepackage{gnuplot-lua-tikz}

グラフは*.texで出力されるので,論文中に含めるときは\input{}でOK. figure環境で包めばキャプションやラベルも付けられる. サイズ変えたいときは\resizebox{}{}{}で.

\begin{figure}
  \centering
  \resizebox{140truemm}{!}{\input{test}}
  \caption{きゃぷしょん}
  \label{fig:test}
\end{figure}

便利.

[改訂第6版] LaTeX2ε美文書作成入門

[改訂第6版] LaTeX2ε美文書作成入門