2016-12-01 11 views
0
#!/bin/bash 

gnuplot -persist <<-EOFMarker 

reset 
set terminal svg enhanced size 500,500 
set output 'plot.svg' 
set autoscale      # scale axes automatically 
unset log        # remove any log-scaling 
     unset label       # remove any previous labels 
     set xtic auto       # set xtics automatically 
     set ytic auto       # set ytics automatically 

set ylabel "Loading (mmol/gm)" 
set xlabel "Pressure (kPa)" 
set key left top 
set key autotitle columnhead 
set grid 

plot "all_isotherm_15.dat" using (($2)/100000):3 title 'Simulation273K' with linespoints , \ 
"all_isotherm_15.dat" using (($2)/100000):5 title 'Simulation298K' with linespoints 
EOFMarker 

を算術演算を使用している場合、私はあなたが文字列としてのbashによって解釈$ 2取得エラーGNUPLOTエラー:bashシェルでDATファイルの1列に

gnuplot> plot "all_isotherm_15.dat" using (/100000):3 title 'Simulation273K' with linespoints , "all_isotherm_15" using (/100000):5 title 'Simulation298K' with linespoints 

    ^

line 0: invalid expression 
+1

使用'カラム(2) 'としてファイルを起動する、シェルスクリプトのインタプリタとしてgnuplotを使用しません – Christoph

答えて

1

の下に取得しています。彼らは定義されていないので、何も置き換えられません。

なぜ直接、すなわち、代わりに `$ 2 'の

#!/usr/bin/gnuplot -persist 

reset 
... 
関連する問題