2008年11月10日月曜日

gnuplotで日本語ラベルのpng出力

MacPortsのgnuplotから文字化けせずにPNGを出力する事が出来たのでメモ。
  1. 日本語フォントのインストール
    $ sudo port install sazanami-font
  2. gnuplot起動とグラフを出力
    $ gnuplot
    gnuplot> set fontpath '/opt/local/share/fonts/sazanami'
    gnuplot> set terminal png font 'sazanami-gothic'
    gnuplot> set output 'sample1.png'
    gnuplot> plot x * x title '放物線'

0 件のコメント: