ghostscript(&gnuplot)

  ここでは gnuplot と ghostscript についての情報を記述する。
--------------------------------------------------------------------------------
■ gnuplot (ニュープロット)

□ 基本的な使用方法
・ 2次元グラフ: plot "data_file" または plot 'data_file'
・ 3次元グラフ: splot "data_file" または splot 'data_file'
・ 再描画: replot
・ 終了: exit または quit, q, Ctrl + d
 
・ データの指定: using xの行:yの行 を追加で記述する。(重要: using は with より前に記述する)
・ 曲線のラベル(=key): title "曲線の名称” x位置、y位置 を追加する。
 (ラベルの位置を替える場合:set kye x位置、y位置 )
 (非表示にする場合: set nokey)

□ 線種及び表示範囲
・ 点線: with linespoints またはそれを短縮した w lp をコマンドに追加する。
・ 線: with lines または w l をコマンドに追加する。
・ 複数のデータプロットは、カンマ , で区切る事で可能になる。
 (例えば、plot "test1.data" with lines, "test2.data" with lines )
・ 範囲の指定: plot [x軸下限:x軸上限] [y軸下限:y軸上限] "data_file"
 (3次元では、 splot  [x軸下限:x軸上限] [y軸下限:y軸上限] [z軸下限:z軸上限] "data_file" となる)
 ( plot [][-:2] "data_file" なども可能)
・簡単な数値計算をしたい場合: 1: ($2*13.6) や ($2 * $3)など、$を付けて()内に式を書くと、計算した値を用いることができる。

□ グラフのスタイル(詳細)
・グラフのスタイルの指定方法: with style 線種(line) 点種(point)
styleの種類
線: line
点: points (サンプル点数を変える場合: set samples サンプル点数)
点線: linespoints
インパルス: inpulses
ドット:dots
階段: steps
誤差グラフ:errorbars (3行目に誤差の下の値、4行目に誤差の上の値 を記述する)
棒グラフ: boxes (幅の変更は set boxwidth 幅 で可能になる)
誤差と棒グラフ: boxerrorbars (5行目に幅の値を記述する)

□ 色
カラー
 set palette rgbformula 22,13,-31
グレー
 set palette defined ( 0 0 0 0, 1 1 1 1 )
 set pal def (0 "white", 1 "black")

□ 注意点(重要)
・  ~記号は使えない。例えば、plot "~/gp/data"
・  データの記述において、データの間に空白またはタブを入れて行を分けても良い。
・  データ間に空行があると with lines などの指定で、線が空行のあるところで途切れる。
・ 3D データでは、データ間に空行が2行あるところで面の表現が途切れる。
  (3Dデータでは、データが同じ個数ごとに1つの空行で区切られている)
・ pi は 3.14159 として定義さている。
・ 最初に # のある行はコメントとして認識される。

□ 環境設定
・ 基本のコマンド: set option
・ 環境の確認: show all

□ 環境設定の詳細
・ プロットの範囲の指定: set xrange [x軸下限:x軸上限]
 (同様に、set yrange や set zrange を用いることでyやz軸の範囲も指定できる)
 (自動設定に戻したい場合は set autoscale、最後にxやxy などの記述すれば自動の設定に戻す軸を指定することもできる)
・ 目盛りの変更: set xtics 開始、間隔、終了の値
 (同様に、set ytics や set ztics も可能)
 (刻みの位置を別個に記述する場合: set tics (刻みの位置1、刻みの位置2、・・・・・・)  とすればよい)
 (ラベルは刻みの位置の指定の前に、"記述したいラベル" を記述することで可能になる)
 (ディフォルトに戻す場合: set xtics で良い。yやzも同様)
 (目盛りをなくすには、set noxtics で可能。yやzも同様)
・ タイトルの変更: set title "タイトル名"
 (位置を指定した場合: set title "タイトル名” x位置, y位置 ) 
・ 軸ラベル: set xlabel "ラベル名” x位置、y位置 (y や zも同様)
・ グラフのサイズ変更: set size xスケール、yスケール
 (ディフォルトに戻す: set size )

□ 3次元プロットの詳細
・ 3次元のデータプロットには、非パラメトリックモード(入力データに z軸の値のみを持つ3次元データをプロット)とパラメトリックモード(入力データに x, y, z軸の値を持つ3次元データをプロット)がある。
・ ディフォルトは 非パラメトリックモードである。
・ 非パラメトリックモード: set noparametric
 (入力データは空行があるまでx軸の値が増加し、空行の次でx軸の値が0に戻りy軸は1増加してx値が増加していく)
・ パラメトリックモード: set parametric
 (入力データはデータを同じ個数毎に空行で区切る。曲面のデータを区切るには空行を2つ入れる)
 (曲面が複数ある場合は、 splot "data_file" index 表示する曲面の番号 で可能になります)
・ 等高線の指定: set contour pos
 (pos には x-y平面を指定する base、曲面上を指定する surface、 それらの両方を指定する both の何れか)
 (等高線の取りやめ: set nocontour、3次元曲面を表示しない場合: set nosurface )

□ 拡張子が.pltのファイルの描画は load *.plt

[1] 矢吹道郎、大竹つよし、「使いこなすGNUPLOT」、テクノプレス
[2] http://www.ualberta.ca/~xz10/gnuplot/legend.html 
[3] gnuplotスクリプトの解説: http://www.ss.scphys.kyoto-u.ac.jp/person/yonezawa/contents/program/gnuplot/
 (投稿論文用の図を作るには上記が非常に参考になる)
[4] Gnuplotの第一歩: http://lagendra.s.kanazawa-u.ac.jp/ogurisu/manuals/gnuplot-intro/
[5] http://graph.pc-physics.com/
[6] http://www.e.ics.nara-wu.ac.jp/~nogu/tips/gnuplot.html
[7] http://ne.phys.kyushu-u.ac.jp/~wakasa/cp/cp7.pdf
[8] http://mag.eee.u-ryukyu.ac.jp/unix/gnuplot/index.html 
[9] http://folk.uio.no/hpl/scripting/doc/gnuplot/Kawano/intro/style.html 
[10] https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/5MavvDbmoi4 

plot soft
・ Pinta: http://pinta-project.com/
・ KolourPaint: http://kolourpaint.sourceforge.net/
・ TuxPaint: http://www.tuxpaint.org/
・ Shutter: http://shutter-project.org/
・ F-Spot: http://f-spot.org/Main_Page
・ Gwenview: http://gwenview.sourceforge.net/
・ Krita: http://krita.org/
・ MyPaint:
・ gimp, gimp-painter
・ GIMSHOP
Inkscape
・ AzDrawing: http://hp.vector.co.jp/authors/VA033749/index.html
・ FireAlpaca
・ SketchBook Copic Edition
・ ArtRage
・ paint.net
・ JTrim
・ xpaint
http://internetcom.jp/linuxtutorial/20100521/1.html
http://d.hatena.ne.jp/ni_no5/20110530/1306738544
http://d.hatena.ne.jp/ni_no5/20130413/1365845878
http://matome.naver.jp/odai/2139410353556158301
http://imecat.web.fc2.com/desktop/graphic.html
http://mymemo.weby117.com/site-admin/graphic-soft_1.html
http://www10.atwiki.jp/gleaning/pages/30.html
http://penguin.tantin.jp/mori/category/%E7%94%BB%E5%83%8F%E3%83%BB%E9%9F%B3%E6%A5%BD%E3%83%BB%E3%83%9E%E3%83%AB%E3%83%81%E3%83%A1%E3%83%87%E3%82%A3%E3%82%A2/%E3%83%9A%E3%82%A4%E3%83%B3%E3%83%88%E7%B3%BB%E3%82%BD%E3%83%95%E3%83%88.html
----------------------------------------------------------------------
■ WIEN2kでのpsファイルを直接編集する方法

1. case.spaghetti_ps ファイルをワードパッドなどで開く。
2. Times-Roman を Arial に全て置換する。
3. () show の()の中を書き換えると表示される文字を変えることができる。
4. Color definitions で、{} bdef の中を全て 0.00 0.00 0.00 に変更する。
  黒 0.00 0.00 0.00
  赤 1.00 0.00 0.00
  緑 0.00 1.00 0.00
  青 0.00 0.00 1.00
5. 縦軸の目盛りは下記のように定義されている。
   0.00000    9.54545 M ←基点
  -0.30000    9.54545 L ←目盛り(左の数値を変えると長さが変わる)
   0.00000    9.54545 M
  -1.50000    9.40545 M ←目盛りの数値(次の行で定義する文字の位置)
/Arial findfont  14.00000 scalefont setfont
(  0.0) show
6.  %vertical lines のところから縦軸の線の設定がなされている。
--------------------------------------------------------------------------------
■ 2D ternary diagram

Command: gnuplot data.gpl

References
https://staff.aist.go.jp/a.noda/programs/ternary/ternary-en.html 
http://www.maibun.org/~nt/technicalnote/centos55/ternary.html 
https://staff.aist.go.jp/a.noda/programs/ternary/ternary.html 
--------------------------------------------------------------------------------
■ 3D ternary diagram

1. copy 3D data (A, B, C, D) to a data.dat
2. open a terminal or consol
3. cd folder including the data.dat
4. copy commands as following
------------------------------------------------
gnuplot

set terminal x11 color enhanced "Arial" 28
# user setting
set title "3D ternary diagram"
z = -100
set zrange [z:400]
set ticslevel 0
offset = 0.03

set bmargin 3
set lmargin 3
set rmargin 3
set tmargin 3
set size ratio 0.866
set yrange [0:0.866]
set xrange [0:1]
set noborder
set noxtics
set noytics
set noztics
#set label 'Y' at 0, -0.03,z center
#set label 'Z' at 1, -0.03,z center
#set label 'X' at 0.5, 0.886,z center
set label 'V' at (0.25-0.06-offset), (0.4330+0.06+offset),z center
set label 'Al' at 0.5,(-0.1-offset),z center
set label 'Fe' at (0.75+0.06+offset),(0.4330+0.06+offset),z center

# x label Al
set label ' 0' at 0,  (-0.03-offset),z center
set label '10' at 0.1,(-0.03-offset),z center
set label '20' at 0.2,(-0.03-offset),z center
set label '30' at 0.3,(-0.03-offset),z center
set label '40' at 0.4,(-0.03-offset),z center
set label '50' at 0.5,(-0.03-offset),z center
set label '60' at 0.6,(-0.03-offset),z center
set label '70' at 0.7,(-0.03-offset),z center
set label '80' at 0.8,(-0.03-offset),z center
set label '90' at 0.9,(-0.03-offset),z center
set label '100' at (1+offset), (-0.03-offset),z center

# z label Fe
set label ' 0' at (1.00+offset),0.0000+offset,z center
set label '10' at (0.95+offset),0.0866+offset,z center
set label '20' at (0.90+offset),0.1730+offset,z center
set label '30' at (0.85+offset),0.2600+offset,z center
set label '40' at (0.80+offset),0.3460+offset,z center
set label '50' at (0.75+offset),0.4330+offset,z center
set label '60' at (0.70+offset),0.5200+offset,z center
set label '70' at (0.65+offset),0.6060+offset,z center
set label '80' at (0.60+offset),0.6930+offset,z center
set label '90' at (0.55+offset),0.7790+offset,z center
set label '100' at (0.50+offset),0.8656+offset,z center

# y label V
set label '100' at (0.00-offset), 0.0000+offset,z center
set label '90' at (0.05-offset), 0.0866+offset,z center
set label '80' at (0.10-offset), 0.1730+offset,z center
set label '70' at (0.15-offset), 0.2600+offset,z center
set label '60' at (0.20-offset), 0.3460+offset,z center
set label '50' at (0.25-offset), 0.4330+offset,z center
set label '40' at (0.30-offset), 0.5200+offset,z center
set label '30' at (0.35-offset), 0.6060+offset,z center
set label '20' at (0.40-offset), 0.6930+offset,z center
set label '10' at (0.45-offset), 0.7790+offset,z center
set label ' 0' at (0.50-offset), 0.8660+offset,z center
#set output 'ternary_gpl.eps'

set style line 1 lt 1 lw 3 pt -1 ps 1
set style line 2 lt 5 lw 1 pt -1 ps 1

# x
set arrow 1 from 0,0,z to 1, 0.0,z nohead linestyle 1 lc rgb "black"
set arrow 2 from 0.1,0,z to 0.55, 0.779,z nohead linestyle 2 lc rgb "grey"
set arrow 3 from 0.2,0,z to 0.60, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 4 from 0.3,0,z to 0.65, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 5 from 0.4,0,z to 0.70, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 6 from 0.5,0,z to 0.75, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 7 from 0.6,0,z to 0.80, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 8 from 0.7,0,z to 0.85, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 9 from 0.8,0,z to 0.90, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 10 from 0.9,0,z to 0.95, 0.0866,z nohead linestyle 2 lc rgb "grey"

# z
set arrow 11 from 1, 0,z to 0.50, 0.866,z nohead linestyle 1 lc rgb "black"
set arrow 12 from 0.95, 0.0866,z to 0.05, 0.0866,z nohead linestyle 2 lc rgb "grey"
set arrow 13 from 0.90, 0.173,z to 0.10, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 14 from 0.85, 0.260,z to 0.15, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 15 from 0.80, 0.346,z to 0.20, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 16 from 0.75, 0.433,z to 0.25, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 17 from 0.70, 0.520,z to 0.30, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 18 from 0.65, 0.606,z to 0.35, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 19 from 0.60, 0.693,z to 0.40, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 20 from 0.55, 0.779,z to 0.45, 0.779,z nohead linestyle 2 lc rgb "grey"

# y
set arrow 21 from 0.50, 0.866,z to 0,0,z nohead linestyle 1 lc rgb "black"
set arrow 22 from 0.05, 0.0866,z to 0.1,0,z nohead linestyle 2 lc rgb "grey"
set arrow 23 from 0.10, 0.173,z to 0.2,0,z nohead linestyle 2 lc rgb "grey"
set arrow 24 from 0.15, 0.260,z to 0.3,0,z nohead linestyle 2 lc rgb "grey"
set arrow 25 from 0.20, 0.346,z to 0.4,0,z nohead linestyle 2 lc rgb "grey"
set arrow 26 from 0.25, 0.433,z to 0.5,0,z nohead linestyle 2 lc rgb "grey"
set arrow 27 from 0.30, 0.520,z to 0.6,0,z nohead linestyle 2 lc rgb "grey"
set arrow 28 from 0.35, 0.606,z to 0.7,0,z nohead linestyle 2 lc rgb "grey"
set arrow 29 from 0.40, 0.693,z to 0.8,0,z nohead linestyle 2 lc rgb "grey"
set arrow 30 from 0.45, 0.779,z to 0.9,0,z nohead linestyle 2 lc rgb "grey"

# plot contour at bottom
set pm3d at b
set contour base
unset clabel

# user setting 2 (grid and color)
set view 47,344, 1.1, 1
set dgrid3d 26,26
set cntrparam levels incremental -100,10,100
set palette rgbformula 22,13,-31

splot "<awk '{print ($1+2*$3)/(2*($1+$2+$3)), sqrt(3)*$1/(2*($1+$2+$3)), $4}' data.dat" t "data" w l lc rgb "black"

# save
#set terminal postscript color enhanced "Arial" 18
#set output 'ternary_gpl.eps'
#replot
------------------------------------------------
5. paste into terminal or consol
6. change an angle
7. save to eps a file
  set terminal postscript color enhanced "Arial" 18
  set output 'ternary_gpl.eps'
  replot
8. close gnuplot
  q
9. check
  gs ternary_gpl.eps

References
http://dsl4.eee.u-ryukyu.ac.jp/DOCS/gnuplot/node128.html 
http://stackoverflow.com/questions/17700262/gnuplot-how-to-obtain-contour-lines-with-the-same-level-color-of-the-3d-plot 
http://ryukyu.astr.tohoku.ac.jp/pukiwiki/index.php?Members%2Fchinone%2F%B3%D0%BD%F1%2FGnuplot 
http://folk.uio.no/hpl/scripting/doc/gnuplot/Kawano/intro/style.html 
--------------------------------------------------------------------------------
■ 3D ternary diagram (box)
 この方法では、データに負の値がある場合、正の方向へ立ち上がるようにならないので注意。

1. copy 3D data (A, B, C, D) to a data.dat
2. open a terminal or consol
3. mkdir 3d_ternary_diagram
4. cd 3d_ternary_diagram
5. cd folder including the data.dat in 3d_ternary_diagram/
6. copy a text file as following
------------------------------------------------
#!/bin/csh -f

set adress=$HOME/3d_ternary_diagram/

awk '{print ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4 "\n" "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" "\n" "\n" }' $adress/data.dat > $adress/3Dbox.dat
------------------------------------------------
7. chmod +x this file
8. run this file,
9. find 3Dbox.dat
10. copy commands as following
------------------------------------------------
gnuplot

set terminal x11 color enhanced "Arial" 28
# user setting
set title "3D ternary diagram"
z = 0
set zrange [z:*]
set ticslevel 0
offset = 0.03

set bmargin 3
set lmargin 3
set rmargin 3
set tmargin 3
set size ratio 0.866
set yrange [0:0.866]
set xrange [0:1]
set noborder
set noxtics
set noytics
set noztics
#set label 'Y' at 0, -0.03,z center
#set label 'Z' at 1, -0.03,z center
#set label 'X' at 0.5, 0.886,z center
set label 'V' at (0.25-0.06-offset), (0.4330+0.06+offset),z center
set label 'Al' at 0.5,(-0.1-offset),z center
set label 'Fe' at (0.75+0.06+offset),(0.4330+0.06+offset),z center

# x label Al
set label '20' at 0,  (-0.03-offset),z center
set label '22' at 0.1,(-0.03-offset),z center
set label '24' at 0.2,(-0.03-offset),z center
set label '26' at 0.3,(-0.03-offset),z center
set label '28' at 0.4,(-0.03-offset),z center
set label '30' at 0.5,(-0.03-offset),z center
set label '32' at 0.6,(-0.03-offset),z center
set label '34' at 0.7,(-0.03-offset),z center
set label '36' at 0.8,(-0.03-offset),z center
set label '38' at 0.9,(-0.03-offset),z center
set label '40' at (1+offset), (-0.03-offset),z center

# z label Fe
set label '40' at (1.00+offset),0.0000+offset,z center
set label '42' at (0.95+offset),0.0866+offset,z center
set label '44' at (0.90+offset),0.1730+offset,z center
set label '46' at (0.85+offset),0.2600+offset,z center
set label '48' at (0.80+offset),0.3460+offset,z center
set label '50' at (0.75+offset),0.4330+offset,z center
set label '52' at (0.70+offset),0.5200+offset,z center
set label '54' at (0.65+offset),0.6060+offset,z center
set label '56' at (0.60+offset),0.6930+offset,z center
set label '58' at (0.55+offset),0.7790+offset,z center
set label '60' at (0.50+offset),0.8656+offset,z center

# y label V
set label '40' at (0.00-offset), 0.0000+offset,z center
set label '38' at (0.05-offset), 0.0866+offset,z center
set label '36' at (0.10-offset), 0.1730+offset,z center
set label '34' at (0.15-offset), 0.2600+offset,z center
set label '32' at (0.20-offset), 0.3460+offset,z center
set label '30' at (0.25-offset), 0.4330+offset,z center
set label '28' at (0.30-offset), 0.5200+offset,z center
set label '26' at (0.35-offset), 0.6060+offset,z center
set label '24' at (0.40-offset), 0.6930+offset,z center
set label '22' at (0.45-offset), 0.7790+offset,z center
set label '20' at (0.50-offset), 0.8660+offset,z center
#set output 'ternary_gpl.eps'

set style line 1 lt 1 lw 3 pt -1 ps 1
set style line 2 lt 5 lw 1 pt -1 ps 1

# x
set arrow 1 from 0,0,z to 1, 0.0,z nohead linestyle 1 lc rgb "black"
set arrow 2 from 0.1,0,z to 0.55, 0.779,z nohead linestyle 2 lc rgb "grey"
set arrow 3 from 0.2,0,z to 0.60, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 4 from 0.3,0,z to 0.65, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 5 from 0.4,0,z to 0.70, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 6 from 0.5,0,z to 0.75, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 7 from 0.6,0,z to 0.80, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 8 from 0.7,0,z to 0.85, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 9 from 0.8,0,z to 0.90, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 10 from 0.9,0,z to 0.95, 0.0866,z nohead linestyle 2 lc rgb "grey"

# z
set arrow 11 from 1, 0,z to 0.50, 0.866,z nohead linestyle 1 lc rgb "black"
set arrow 12 from 0.95, 0.0866,z to 0.05, 0.0866,z nohead linestyle 2 lc rgb "grey"
set arrow 13 from 0.90, 0.173,z to 0.10, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 14 from 0.85, 0.260,z to 0.15, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 15 from 0.80, 0.346,z to 0.20, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 16 from 0.75, 0.433,z to 0.25, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 17 from 0.70, 0.520,z to 0.30, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 18 from 0.65, 0.606,z to 0.35, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 19 from 0.60, 0.693,z to 0.40, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 20 from 0.55, 0.779,z to 0.45, 0.779,z nohead linestyle 2 lc rgb "grey"

# y
set arrow 21 from 0.50, 0.866,z to 0,0,z nohead linestyle 1 lc rgb "black"
set arrow 22 from 0.05, 0.0866,z to 0.1,0,z nohead linestyle 2 lc rgb "grey"
set arrow 23 from 0.10, 0.173,z to 0.2,0,z nohead linestyle 2 lc rgb "grey"
set arrow 24 from 0.15, 0.260,z to 0.3,0,z nohead linestyle 2 lc rgb "grey"
set arrow 25 from 0.20, 0.346,z to 0.4,0,z nohead linestyle 2 lc rgb "grey"
set arrow 26 from 0.25, 0.433,z to 0.5,0,z nohead linestyle 2 lc rgb "grey"
set arrow 27 from 0.30, 0.520,z to 0.6,0,z nohead linestyle 2 lc rgb "grey"
set arrow 28 from 0.35, 0.606,z to 0.7,0,z nohead linestyle 2 lc rgb "grey"
set arrow 29 from 0.40, 0.693,z to 0.8,0,z nohead linestyle 2 lc rgb "grey"
set arrow 30 from 0.45, 0.779,z to 0.9,0,z nohead linestyle 2 lc rgb "grey"

# plot contour at bottom
#set pm3d at ss
#set pm3d at b
set pm3d
#set pm3d map
#set contour base
#set contour surface
#set contour both
unset clabel

# user setting 2 (grid and color)
set view 53,337, 1.1, 1
# grey
set palette defined ( 0 0 0 0, 1 1 1 1 )
# set pal def (0 "white", 1 "black")
# color
#set palette rgbformula 22,13,-31
#set palette rgbformulae 33,13,10
#unset colorbox
#set parametric

# hidden
set hidden3d

#set multiplot

splot "<awk '{print $1, $2, $3}' 3Dbox.dat" with pm3d

#unset key title

#unset multiplot

# save
#set terminal postscript color enhanced "Arial" 18
#set output 'ternary_gpl.eps'
#replot
------------------------------------------------
11. paste into terminal or consol
12. change an angle
13. save to eps a file
  set terminal postscript color enhanced "Arial" 18
  set output 'ternary_gpl.eps'
  replot
14. close gnuplot
  q
15. check
  gs ternary_gpl.eps

--------------------------------------------------------------------------------
■ 3D ternary diagram (box)
 上記の方法では、データに負の値がある場合、Zが正の方向へ立ち上がるようにならない。この場合は下記のようにする。
Paint
1. まず試しの図をプロットする。
2. set view で視点を固定する(左下にviewの値が出る。 view: 角度,角度, 倍率, 1)。set view 角度,角度, 倍率, 1
3. 下地の図を作成する。
4. 下地の一部分を消して set multiplot で グラフを重ね合わせた図を作る。
(Zの幅が変わるので、固定するか、問題の無い場所にダミーのデータを入れて描画させ、後で消す。set rangeも用いることが重要)
5. GSview -> File -> Convert -> tiff -> ペイント -> 選択でコピーする範囲を指定 -> 選択 -> 透明の選択にチェックを入れて、複数の図を合わせる。

KolourPaint
1. Image -> rotate right
2. change delta under Colors: KolourPaint Defaults
3. dripping square at left side
4. click while part
5. copy and past

3Dデータ(data.dat)をbox(3Dbox.dat)へ変換 
(cshスクリプトとしてファイルを指定しているが、bashスクリプトなどでもよいと思う。あまり気にしない)
 3Dbox.dat というファイルが生成される。幅を変えたい場合は、下記にある 0.01 を置換して他の値にしてください。
------------------------------------------------
#!/bin/csh -f

set adress=$HOME/3d_ternary_diagram/

awk '{print ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4 "\n" "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))-0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, 0.0 "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))-0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, $4  "\n" ($1+2*$3)/(2*($1+$2+$3))+0.01, sqrt(3)*$1/(2*($1+$2+$3))+0.01, 0.0 "\n" "\n" "\n" }' $adress/data.dat > $adress/3Dbox.dat
------------------------------------------------

試しの図とスケール
------------------------------------------------
gnuplot

set terminal x11 color enhanced "Arial" 28

# user setting
set view 10,343, 1.1, 1
set title "3D ternary diagram (base) "
offset = 0.03
z = 0
#set zrange[-200:200]
set ticslevel 0

set bmargin 3
set lmargin 3
set rmargin 3
set tmargin 3
set size ratio 0.866
set yrange [0:0.866]
set xrange [0:1]
set noborder
set noxtics
set noytics
set noztics
#set label 'Y' at 0, -0.03,z center
#set label 'Z' at 1, -0.03,z center
#set label 'X' at 0.5, 0.886,z center
set label 'V' at (0.25-0.06-offset), (0.4330+0.06+offset),z center
set label 'Al' at 0.5,(-0.1-offset),z center
set label 'Fe' at (0.75+0.06+offset),(0.4330+0.06+offset),z center

# x label Al
set label '20' at 0,  (-0.03-offset),z center
set label '22' at 0.1,(-0.03-offset),z center
set label '24' at 0.2,(-0.03-offset),z center
set label '26' at 0.3,(-0.03-offset),z center
set label '28' at 0.4,(-0.03-offset),z center
set label '30' at 0.5,(-0.03-offset),z center
set label '32' at 0.6,(-0.03-offset),z center
set label '34' at 0.7,(-0.03-offset),z center
set label '36' at 0.8,(-0.03-offset),z center
set label '38' at 0.9,(-0.03-offset),z center
set label '40' at (1+offset), (-0.03-offset),z center

# z label Fe
set label '40' at (1.00+offset),0.0000+offset,z center
set label '42' at (0.95+offset),0.0866+offset,z center
set label '44' at (0.90+offset),0.1730+offset,z center
set label '46' at (0.85+offset),0.2600+offset,z center
set label '48' at (0.80+offset),0.3460+offset,z center
set label '50' at (0.75+offset),0.4330+offset,z center
set label '52' at (0.70+offset),0.5200+offset,z center
set label '54' at (0.65+offset),0.6060+offset,z center
set label '56' at (0.60+offset),0.6930+offset,z center
set label '58' at (0.55+offset),0.7790+offset,z center
set label '60' at (0.50+offset),0.8656+offset,z center

# y label V
set label '40' at (0.00-offset), 0.0000+offset,z center
set label '38' at (0.05-offset), 0.0866+offset,z center
set label '36' at (0.10-offset), 0.1730+offset,z center
set label '34' at (0.15-offset), 0.2600+offset,z center
set label '32' at (0.20-offset), 0.3460+offset,z center
set label '30' at (0.25-offset), 0.4330+offset,z center
set label '28' at (0.30-offset), 0.5200+offset,z center
set label '26' at (0.35-offset), 0.6060+offset,z center
set label '24' at (0.40-offset), 0.6930+offset,z center
set label '22' at (0.45-offset), 0.7790+offset,z center
set label '20' at (0.50-offset), 0.8660+offset,z center
#set output 'ternary_gpl.eps'

set style line 1 lt 1 lw 3 pt -1 ps 1
set style line 2 lt 5 lw 1 pt -1 ps 1

# x
set arrow 1 from 0,0,z to 1, 0.0,z nohead linestyle 1 lc rgb "black"
set arrow 2 from 0.1,0,z to 0.55, 0.779,z nohead linestyle 2 lc rgb "grey"
set arrow 3 from 0.2,0,z to 0.60, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 4 from 0.3,0,z to 0.65, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 5 from 0.4,0,z to 0.70, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 6 from 0.5,0,z to 0.75, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 7 from 0.6,0,z to 0.80, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 8 from 0.7,0,z to 0.85, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 9 from 0.8,0,z to 0.90, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 10 from 0.9,0,z to 0.95, 0.0866,z nohead linestyle 2 lc rgb "grey"

# z
set arrow 11 from 1, 0,z to 0.50, 0.866,z nohead linestyle 1 lc rgb "black"
set arrow 12 from 0.95, 0.0866,z to 0.05, 0.0866,z nohead linestyle 2 lc rgb "grey"
set arrow 13 from 0.90, 0.173,z to 0.10, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 14 from 0.85, 0.260,z to 0.15, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 15 from 0.80, 0.346,z to 0.20, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 16 from 0.75, 0.433,z to 0.25, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 17 from 0.70, 0.520,z to 0.30, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 18 from 0.65, 0.606,z to 0.35, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 19 from 0.60, 0.693,z to 0.40, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 20 from 0.55, 0.779,z to 0.45, 0.779,z nohead linestyle 2 lc rgb "grey"

# y
set arrow 21 from 0.50, 0.866,z to 0,0,z nohead linestyle 1 lc rgb "black"
set arrow 22 from 0.05, 0.0866,z to 0.1,0,z nohead linestyle 2 lc rgb "grey"
set arrow 23 from 0.10, 0.173,z to 0.2,0,z nohead linestyle 2 lc rgb "grey"
set arrow 24 from 0.15, 0.260,z to 0.3,0,z nohead linestyle 2 lc rgb "grey"
set arrow 25 from 0.20, 0.346,z to 0.4,0,z nohead linestyle 2 lc rgb "grey"
set arrow 26 from 0.25, 0.433,z to 0.5,0,z nohead linestyle 2 lc rgb "grey"
set arrow 27 from 0.30, 0.520,z to 0.6,0,z nohead linestyle 2 lc rgb "grey"
set arrow 28 from 0.35, 0.606,z to 0.7,0,z nohead linestyle 2 lc rgb "grey"
set arrow 29 from 0.40, 0.693,z to 0.8,0,z nohead linestyle 2 lc rgb "grey"
set arrow 30 from 0.45, 0.779,z to 0.9,0,z nohead linestyle 2 lc rgb "grey"

# plot contour at bottom
set pm3d
unset clabel

# user setting 2 (grid and color)
# grey
set palette defined ( 0 0 0 0, 1 1 1 1 )
#set pal def (0 "white", 1 "black")
#set zrange reverse
# color
#set palette rgbformula 22,13,-31
#set palette rgbformulae 33,13,10

# hidden
set hidden3d

splot "<awk '{print $1, $2, $3}' 3Dbox.dat"with pm3d

# save
#set terminal postscript color enhanced "Arial" 18
#set output 'ternary_gpl.eps'
#replot
------------------------------------------------

下地の図
------------------------------------------------
gnuplot

set terminal x11 color enhanced "Arial" 28

# user setting
set view 10,343, 1.1, 1
set title "3D ternary diagram (base) "
offset = 0.03
z = 0
#set zrange[-200:200]
set ticslevel 0

set bmargin 3
set lmargin 3
set rmargin 3
set tmargin 3
set size ratio 0.866
set yrange [0:0.866]
set xrange [0:1]
set noborder
set noxtics
set noytics
set noztics
#set label 'Y' at 0, -0.03,z center
#set label 'Z' at 1, -0.03,z center
#set label 'X' at 0.5, 0.886,z center
set label 'V' at (0.25-0.06-offset), (0.4330+0.06+offset),z center
set label 'Al' at 0.5,(-0.1-offset),z center
set label 'Fe' at (0.75+0.06+offset),(0.4330+0.06+offset),z center

# x label Al
set label '20' at 0,  (-0.03-offset),z center
set label '22' at 0.1,(-0.03-offset),z center
set label '24' at 0.2,(-0.03-offset),z center
set label '26' at 0.3,(-0.03-offset),z center
set label '28' at 0.4,(-0.03-offset),z center
set label '30' at 0.5,(-0.03-offset),z center
set label '32' at 0.6,(-0.03-offset),z center
set label '34' at 0.7,(-0.03-offset),z center
set label '36' at 0.8,(-0.03-offset),z center
set label '38' at 0.9,(-0.03-offset),z center
set label '40' at (1+offset), (-0.03-offset),z center

# z label Fe
set label '40' at (1.00+offset),0.0000+offset,z center
set label '42' at (0.95+offset),0.0866+offset,z center
set label '44' at (0.90+offset),0.1730+offset,z center
set label '46' at (0.85+offset),0.2600+offset,z center
set label '48' at (0.80+offset),0.3460+offset,z center
set label '50' at (0.75+offset),0.4330+offset,z center
set label '52' at (0.70+offset),0.5200+offset,z center
set label '54' at (0.65+offset),0.6060+offset,z center
set label '56' at (0.60+offset),0.6930+offset,z center
set label '58' at (0.55+offset),0.7790+offset,z center
set label '60' at (0.50+offset),0.8656+offset,z center

# y label V
set label '40' at (0.00-offset), 0.0000+offset,z center
set label '38' at (0.05-offset), 0.0866+offset,z center
set label '36' at (0.10-offset), 0.1730+offset,z center
set label '34' at (0.15-offset), 0.2600+offset,z center
set label '32' at (0.20-offset), 0.3460+offset,z center
set label '30' at (0.25-offset), 0.4330+offset,z center
set label '28' at (0.30-offset), 0.5200+offset,z center
set label '26' at (0.35-offset), 0.6060+offset,z center
set label '24' at (0.40-offset), 0.6930+offset,z center
set label '22' at (0.45-offset), 0.7790+offset,z center
set label '20' at (0.50-offset), 0.8660+offset,z center
#set output 'ternary_gpl.eps'

set style line 1 lt 1 lw 3 pt -1 ps 1
set style line 2 lt 5 lw 1 pt -1 ps 1

# x
set arrow 1 from 0,0,z to 1, 0.0,z nohead linestyle 1 lc rgb "black"
set arrow 2 from 0.1,0,z to 0.55, 0.779,z nohead linestyle 2 lc rgb "grey"
set arrow 3 from 0.2,0,z to 0.60, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 4 from 0.3,0,z to 0.65, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 5 from 0.4,0,z to 0.70, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 6 from 0.5,0,z to 0.75, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 7 from 0.6,0,z to 0.80, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 8 from 0.7,0,z to 0.85, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 9 from 0.8,0,z to 0.90, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 10 from 0.9,0,z to 0.95, 0.0866,z nohead linestyle 2 lc rgb "grey"

# z
set arrow 11 from 1, 0,z to 0.50, 0.866,z nohead linestyle 1 lc rgb "black"
set arrow 12 from 0.95, 0.0866,z to 0.05, 0.0866,z nohead linestyle 2 lc rgb "grey"
set arrow 13 from 0.90, 0.173,z to 0.10, 0.173,z nohead linestyle 2 lc rgb "grey"
set arrow 14 from 0.85, 0.260,z to 0.15, 0.260,z nohead linestyle 2 lc rgb "grey"
set arrow 15 from 0.80, 0.346,z to 0.20, 0.346,z nohead linestyle 2 lc rgb "grey"
set arrow 16 from 0.75, 0.433,z to 0.25, 0.433,z nohead linestyle 2 lc rgb "grey"
set arrow 17 from 0.70, 0.520,z to 0.30, 0.520,z nohead linestyle 2 lc rgb "grey"
set arrow 18 from 0.65, 0.606,z to 0.35, 0.606,z nohead linestyle 2 lc rgb "grey"
set arrow 19 from 0.60, 0.693,z to 0.40, 0.693,z nohead linestyle 2 lc rgb "grey"
set arrow 20 from 0.55, 0.779,z to 0.45, 0.779,z nohead linestyle 2 lc rgb "grey"

# y
set arrow 21 from 0.50, 0.866,z to 0,0,z nohead linestyle 1 lc rgb "black"
set arrow 22 from 0.05, 0.0866,z to 0.1,0,z nohead linestyle 2 lc rgb "grey"
set arrow 23 from 0.10, 0.173,z to 0.2,0,z nohead linestyle 2 lc rgb "grey"
set arrow 24 from 0.15, 0.260,z to 0.3,0,z nohead linestyle 2 lc rgb "grey"
set arrow 25 from 0.20, 0.346,z to 0.4,0,z nohead linestyle 2 lc rgb "grey"
set arrow 26 from 0.25, 0.433,z to 0.5,0,z nohead linestyle 2 lc rgb "grey"
set arrow 27 from 0.30, 0.520,z to 0.6,0,z nohead linestyle 2 lc rgb "grey"
set arrow 28 from 0.35, 0.606,z to 0.7,0,z nohead linestyle 2 lc rgb "grey"
set arrow 29 from 0.40, 0.693,z to 0.8,0,z nohead linestyle 2 lc rgb "grey"
set arrow 30 from 0.45, 0.779,z to 0.9,0,z nohead linestyle 2 lc rgb "grey"

# plot contour at bottom
set pm3d
unset clabel

unset colorbox

# dummy small sphere
r=1/10000
set parametric
set urange [0:3.0/2*pi]
set vrange [-pi/2:pi/2]
# Parametric functions for the sphere
fx(v,u) = r*cos(v)*cos(u)
fy(v,u) = r*cos(v)*sin(u)
fz(v)   = r*sin(v)
splot fx(v,u),fy(v,u),fz(v)

# save
#set terminal postscript color enhanced "Arial" 18
#set output 'ternary_gpl.eps'
#replot
------------------------------------------------

グラフの図
------------------------------------------------
gnuplot

set terminal x11 color enhanced "Arial" 28

# user setting
set view 10,343, 1.1, 1
set title "3D ternary diagram "
offset = 0.03
z = 0
#set zrange[-200:200]
set ticslevel 0

set bmargin 3
set lmargin 3
set rmargin 3
set tmargin 3
set size ratio 0.866
set yrange [0:0.866]
set xrange [0:1]
set noborder
set noxtics
set noytics
set noztics
#set label 'Y' at 0, -0.03,z center
#set label 'Z' at 1, -0.03,z center
#set label 'X' at 0.5, 0.886,z center
set label 'V' at (0.25-0.06-offset), (0.4330+0.06+offset),z center
set label 'Al' at 0.5,(-0.1-offset),z center
set label 'Fe' at (0.75+0.06+offset),(0.4330+0.06+offset),z center

# x label Al
set label '20' at 0,  (-0.03-offset),z center
set label '22' at 0.1,(-0.03-offset),z center
set label '24' at 0.2,(-0.03-offset),z center
set label '26' at 0.3,(-0.03-offset),z center
set label '28' at 0.4,(-0.03-offset),z center
set label '30' at 0.5,(-0.03-offset),z center
set label '32' at 0.6,(-0.03-offset),z center
set label '34' at 0.7,(-0.03-offset),z center
set label '36' at 0.8,(-0.03-offset),z center
set label '38' at 0.9,(-0.03-offset),z center
set label '40' at (1+offset), (-0.03-offset),z center

# z label Fe
set label '40' at (1.00+offset),0.0000+offset,z center
set label '42' at (0.95+offset),0.0866+offset,z center
set label '44' at (0.90+offset),0.1730+offset,z center
set label '46' at (0.85+offset),0.2600+offset,z center
set label '48' at (0.80+offset),0.3460+offset,z center
set label '50' at (0.75+offset),0.4330+offset,z center
set label '52' at (0.70+offset),0.5200+offset,z center
set label '54' at (0.65+offset),0.6060+offset,z center
set label '56' at (0.60+offset),0.6930+offset,z center
set label '58' at (0.55+offset),0.7790+offset,z center
set label '60' at (0.50+offset),0.8656+offset,z center

# y label V
set label '40' at (0.00-offset), 0.0000+offset,z center
set label '38' at (0.05-offset), 0.0866+offset,z center
set label '36' at (0.10-offset), 0.1730+offset,z center
set label '34' at (0.15-offset), 0.2600+offset,z center
set label '32' at (0.20-offset), 0.3460+offset,z center
set label '30' at (0.25-offset), 0.4330+offset,z center
set label '28' at (0.30-offset), 0.5200+offset,z center
set label '26' at (0.35-offset), 0.6060+offset,z center
set label '24' at (0.40-offset), 0.6930+offset,z center
set label '22' at (0.45-offset), 0.7790+offset,z center
set label '20' at (0.50-offset), 0.8660+offset,z center
#set output 'ternary_gpl.eps'

set style line 1 lt 1 lw 3 pt -1 ps 1
set style line 2 lt 5 lw 1 pt -1 ps 1

# x
set arrow 1 from 0,0,z to 1, 0.0,z nohead linestyle 1 lc rgb "black"

# z
set arrow 11 from 1, 0,z to 0.50, 0.866,z nohead linestyle 1 lc rgb "black"

# y
set arrow 21 from 0.50, 0.866,z to 0,0,z nohead linestyle 1 lc rgb "black"

# plot contour at bottom
#set pm3d at ss
#set pm3d at b
set pm3d
#set pm3d map
#set contour base
#set contour surface
#set contour both
unset clabel

# user setting 2 (grid and color)
# grey
#set palette defined ( 0 0 0 0, 1 1 1 1 )
#set pal def (0 "white", 1 "black")
#set zrange reverse
# color
#set palette rgbformula 22,13,-31
#set palette rgbformulae 33,13,10
#unset colorbox
#set parametric

# hidden
set hidden3d

set multiplot
#
# plus data
#set zrange [-200:200]
# grey
set palette defined ( 0 0 0 0, 1 1 1 1 )
splot "<awk '{print $1, $2, $3}' 3Dbox_p.dat" with pm3d
unset colorbox
#
# minus data
#set zrange [-200:200] reverse
# grey
set palette defined (0 "white", 1 "black")
splot "<awk '{print $1, $2, $3}' 3Dbox_n.dat" with pm3d
unset colorbox
#
unset multiplot

# save
#set terminal postscript color enhanced "Arial" 18
#set output 'ternary_gpl.eps'
#replot
------------------------------------------------

--------------------------------------------------------------------------------
■ gnuplot による ps と eps ファイルの作成

gnuplot

set size 1.0, 1.0
set xr[-12.0:40.0]
set xl "{/=25 Energy / eV }"
set yr[0.0:*]
set yl "{/=25 Density of States / eV.atom }"

set y2tics
set logscale y2
set y2r[0.001:100]
set y2l "{/=25 F(E_F) }"

plot "data" using 1:2 w lp title "Total DOS"
replot "data" using 1:3 w lp title "F(E_F)" axes x1y2

set terminal postscript color enhanced "Arial" 25
set out "graph.ps"
replot

set terminal postscript eps color enhanced "Arial" 25
set out "graph.eps"
replot

set terminal x11

quit

[1] http://www.ss.scphys.kyoto-u.ac.jp/person/yonezawa/contents/program/gnuplot/paper1.html 
[2] http://lagendra.s.kanazawa-u.ac.jp/ogurisu/manuals/gnuplot-intro/file.html#file21 
[3] http://lagendra.s.kanazawa-u.ac.jp/ogurisu/manuals/gnuplot-intro/print.html 
[4] http://graph.pc-physics.com/ 
[5] http://graph.pc-physics.com/range.html 
[6] http://www.ss.scphys.kyoto-u.ac.jp/person/yonezawa/contents/program/gnuplot/ 
 --------------------------------------------------------------------------------
■ Results for BandUP
gnuplot

#set terminal postscript eps color enhanced "Arial" 28
set terminal postscript eps color enhanced "Helvetica" 28
set output "folding.eps"
#set multiplot layout 1,2

#set lmargin 1
#set rmargin 1
#set tmargin 1
#set bmargin 1

#set view 0,360,1.0,1.0

#set size 0.3, 1.2
#set size 0.9, 3.6
set size 1, 3

set title "unfolding band structure" 0, 0

#set pointsize 0.5

unset ztics

unset xtics

set ytics -10, 2, 10

set key 0.5,-15

set format y "%4.1f"

set label 1 font 'Symbol' "G" at -0.01,-14
set label 2 "X" at 0.75,-14

set zeroaxis

set pm3d map
set dgrid3d 750,750
#set palette rgbformulae 33,13,10
set zrange[*:1]
set palette defined (0"#ffffff",1"#0000ff",2"#ff0000",3"#ffff00")
set ylabel font 'Helvetica, 35' 'Energy / eV'

splot '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe2VAl/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title 'Fe_{64}V_{32}Al_{32}'

--------------------------------------------
gnuplot

set terminal png enhanced
set output "folding.png"

set size 1, 3

set title "unfolding band structure" 0, 0

unset ztics

unset xtics

set ytics -10, 2, 10

set key 0.5,-15

set format y "%4.1f"

set label 1 "G" at -0.01,-14
set label 2 "X" at 0.75,-14

set zeroaxis

set pm3d map
set dgrid3d 750,750
set zrange[*:1]
set palette defined (0"#ffffff",1"#0000ff",2"#ff0000",3"#ffff00")
set ylabel 'Energy / eV'

splot '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe2VAl/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title 'Fe_{64}V_{32}Al_{32}'

--------------------------------------------
gnuplot

#set terminal postscript eps color enhanced "Arial" 28
set terminal postscript eps color enhanced "Helvetica" 28
set output "folding.eps"
set multiplot layout 1,2

set lmargin 1
set rmargin 1
set tmargin 1
set bmargin 1

set size 0.5, 3

set title "unfolding band structure" 0, 0

unset ztics

unset xtics

set ytics -10, 2, 10

set key 0.73,-15

set format y "%4.1f"

set label 1 font 'Symbol' "G" at -0.01,-14
set label 2 "X" at 0.75,-14

set zeroaxis

set pm3d map
set dgrid3d 750,750
#set palette rgbformulae 33,13,10
set zrange[*:1]
set palette defined (0"#ffffff",1"#0000ff",2"#ff0000",3"#ffff00")
set ylabel font 'Helvetica, 35' 'Energy / eV'

splot '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe2VAl/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title "Fe_{64}V_{32}Al_{32}"

# -----------------
set lmargin 8
set rmargin 1
set tmargin 1
set bmargin 1

set size 0.665, 3

set title "unfolding band structure" 0, 0

unset ztics

unset xtics

set ytics -10, 2, 10

set key 0.75,-15

set format y "%4.1f"

set label 1 font 'Symbol' "G" at -0.01,-14
set label 2 "X" at 0.75,-14

set zeroaxis

set pm3d map
set dgrid3d 750,750
#set palette rgbformulae 33,13,10
set zrange[*:1]
set palette defined (0"#ffffff",1"#0000ff",2"#ff0000",3"#ffff00")
set ylabel font 'Helvetica, 35' 'Energy / eV'

splot '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe64V33Al31_ENCUT400_accurate/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title "Fe_{64}V_{33}Al_{31}"

--------------------------------------------
gnuplot

#set terminal postscript eps color enhanced "Arial" 28
set terminal postscript eps color enhanced "Helvetica" 28
set output "folding.eps"
#set multiplot layout 1,2

set view 0,360,1.0,1.0

set size 0.8, 3.6

set title "unfolding band structure" 0, -12

set pointsize 0.5

unset ztics

unset xtics

set ytics -10, 2, 10

set key 0.55,-15

set format y "%4.1f"

set label 1 font 'Symbol' "G" at -0.01,-14
set label 2 "X" at 0.75,-14

set zeroaxis

#set pm3d map
#set dgrid3d 750,750
#set palette rgbformulae 33,13,10
#set zrange[*:1]
#set palette defined (0"#ffffff",1"#0000ff",2"#ff0000",3"#ffff00")

set zrange[0.1:]
set label 3 font 'Helvetica, 35' "Energy / eV" at 1.04,-2 rotate by 90

splot '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe2VAl/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title 'Fe_{64}V_{32}Al_{32}' with points 1 5, '/home/pc4/band_unfolding-master/tutorial/example_2_bulk_Fe64V33Al31_ENCUT400_accurate/step_4_run_BandUP_and_plot/plot/direction_L-G_G-X_X-U_K-G/unfolded_EBS_symmetry-averaged.dat' title "Fe_{64}V_{33}Al_{31}" with points 3 5
 --------------------------------------------------------------------------------
■ csh script (type1)
#!/bin/csh -f

set file     = `pwd`
set filename = $file:h
set filename = $filename:t
set psformat = "_THHR.ps"
set epsformat = "_THHR.eps"

gnuplot -persist << EOF

set title "$filename L=20"
set size 0.7,1.0
set xr[-12.0:30.0]
set xl "{/=30 Energy / eV }"
set yr[0.0:*]
set yl "{/=30 <{|2(k+G)|}^2>[x(2{/Symbol p}/a)^2] }"

set y2tics
set logscale y2
set y2r[0.001:100]
set y2l "{/=30 F(E_F) }"

set yzeroaxis lt 1 lw 2 lc rgb "black"

# linetype=lt, linecolor=lc, linewidth=lw, pointtype=pt, pointsize=ps
# with=w, line=l, color setting=lc rgb "",
set key box center top
plot "$file/results/THHR/TH_HR.DATA" using 1:2 w l lt 1 lw 2 lc rgb "grey" title "TH-HR curve"
replot "$file/results/THHR/TH_HR.DATA" using 1:5 w l lt 1 lw 2 lc rgb "pink" title "F(E_F)" axes x1y2
replot "$file/results/THHR/C2_020.DATA" w p pt 7 ps 1 lc rgb "green" title " {/Symbol S}|C|^2 >= 0.2"
replot "$file/results/NFE_L20/CG_020_L20.DATA" w p pt 7 ps 1 lc rgb "magenta" title " {/Symbol S}|C^c^g|^2 >= 0.2"
replot "$file/results/NFE_L20/NFE_HR_L20.DATA" w l lt 1 lw 2 lc rgb "black" title " NFE-HR curve"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"
#replot

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"
replot

set terminal x11

EOF
 --------------------------------------------------------------------------------
■ csh script (type2)
#!/bin/csh -f

set file     = `pwd`
set filename = $file:h
set filename = $filename:t
set psformat = "_Cmax2.ps"
set epsformat = "_Cmax2.eps"

gnuplot -persist << EOF

set title "$filename"
set size 0.7,1.0
set xr[-12.0:30.0]
set xl "{/=30 Energy  / eV]}"
set yr[0.0:*]
set yl "{/=30 <{|C|}^2_m_a_x>}"

set yzeroaxis lt 1 lw 2 lc rgb "black"

# linetype=lt, linecolor=lc, linewidth=lw, pointtype=pt, pointsize=ps
# with=w, line=l, color setting=lc rgb "",
set key box center top
plot "$file/results/THHR/TH_HR.DATA" using 1:4 w l lt 1 lw 2 lc rgb "black" title "{/=30 <{|C|}^2_m_a_x>}"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"
#replot

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"
replot

set terminal x11

EOF
 --------------------------------------------------------------------------------
#! /bin/sh

Adress=/home/pc2/NFE-HR

echo "Start"
date

mv *.klist f03
mv *.output1 f26
mv *.output2 f15
mv *.outputkgen f17
mv *.struct f60

mkdir results
cd results
mkdir THHR
cd ..

echo " "
echo " "
echo "Make ALL k point list for HR calculation"
$Adress/makethhrklist

echo " "
echo " "
echo "Make input files for HR calculation"
$Adress/makethhrinput

echo " "
echo " "
echo "Calculating TH-HR"
$Adress/calcthhr
mv AKK.DATA  ./results/THHR/TH_HR.DATA
mv AKK2.DATA ./results/THHR/C2_005.DATA
mv AKK3.DATA ./results/THHR/C2_020.DATA
mv AKK4.DATA ./results/THHR/C2_050.DATA

echo " "
echo " "
echo "Calculating NFE-HR for L=1"
echo "LMAX=1" > LMAX
mv LMAX f75
$Adress/calcnfehr
cd results
mkdir NFE_L1
cd ..
mv AKK5.DATA ./results/NFE_L1/NFE_HR_L1.DATA
mv AKK6.DATA ./results/NFE_L1/CG_005_L1.DATA
mv AKK7.DATA ./results/NFE_L1/CG_020_L1.DATA
mv AKK8.DATA ./results/NFE_L1/CG_050_L1.DATA

#echo " "
#echo " "
#echo "Calculating NFE-HR for L=10"
#echo "LMAX=10" > LMAX
#mv LMAX f75
#$Adress/calcnfehr
#cd results
#mkdir NFE_L10
#cd ..
#mv AKK5.DATA ./results/NFE_L10/NFE_HR_L10.DATA
#mv AKK6.DATA ./results/NFE_L10/CG_005_L10.DATA
#mv AKK7.DATA ./results/NFE_L10/CG_020_L10.DATA
#mv AKK8.DATA ./results/NFE_L10/CG_050_L10.DATA

echo " "
echo " "
echo "Calculating NFE-HR for L=20"
echo "LMAX=20" > LMAX
mv LMAX f75
$Adress/calcnfehr
cd results
mkdir NFE_L20
cd ..
mv AKK5.DATA ./results/NFE_L20/NFE_HR_L20.DATA
mv AKK6.DATA ./results/NFE_L20/CG_005_L20.DATA
mv AKK7.DATA ./results/NFE_L20/CG_020_L20.DATA
mv AKK8.DATA ./results/NFE_L20/CG_050_L20.DATA

mv f03 wien.klist
mv f26 wien.output1
mv f15 wien.output2
mv f17 wien.outputkgen
mv f60 wien.struct
cp f75 LMAX
#
rm f01
#rm f13
#rm f14
#rm f16
#
Adress=/home/pc2/NFE-HR
cp ./results/THHR/TH_HR.DATA         ./results/THHR/TH_HR_gnuplot.DATA
cp ./results/THHR/C2_020.DATA        ./results/THHR/C2_020_gnuplot.DATA
cp ./results/NFE_L20/NFE_HR_L20.DATA ./results/NFE_L20/NFE_HR_L20_gnuplot.DATA
cp ./results/NFE_L20/CG_020_L20.DATA ./results/NFE_L20/CG_020_L20_gnuplot.DATA
sed -i -e "1d" ./results/THHR/TH_HR_gnuplot.DATA
sed -i -e "1d" ./results/THHR/C2_020_gnuplot.DATA
sed -i -e "1d" ./results/NFE_L20/NFE_HR_L20_gnuplot.DATA
sed -i -e "1d" ./results/NFE_L20/CG_020_L20_gnuplot.DATA
$Adress/hrplot
$Adress/cplot
rm ./results/THHR/TH_HR_gnuplot.DATA
rm ./results/THHR/C2_020_gnuplot.DATA
rm ./results/NFE_L20/NFE_HR_L20_gnuplot.DATA
rm ./results/NFE_L20/CG_020_L20_gnuplot.DATA

echo "END"
date
 --------------------------------------------------------------------------------


QRコード
携帯用QRコード
アクセス数
ページビュー数
[無料でホームページを作成] [通報・削除依頼]