gnuplot / plot (7)
not so FAQ
|
2次元プロットのあれこれ (その7)正規確率軸を用いた図の表示. from Dr. Moriyama. Thanks !
粉体やエアロゾルなど粒子を扱う分野では, 累積体積割合 vs 粒径のプロッ gnuplot> set ytics ("0.1" invnorm(0.001),"1" invnorm(0.01),"5" invnorm(0.05), > "10" invnorm(0.1),"20" invnorm(0.2),"30" invnorm(0.3), > "40" invnorm(0.4),"50" invnorm(0.5),"60" invnorm(0.6), > "70" invnorm(0.7),"80" invnorm(0.8),"90" invnorm(0.9), > "95" invnorm(0.95),"99" invnorm(0.99),"99.9" invnorm(0.999)) gnuplot> set yrange [invnorm(0.0001):invnorm(0.9999)] gnuplot> set ylabel "Cumulative mass fraction (%)" gnuplot> set xlabel "Diameter (mm)" gnuplot> set logscale x gnuplot> set grid gnuplot> plot "sample.dat" using 1:(invnorm($2)) notitle w lp この例では,データが対数正規分布をしていると考えているため,X軸に対 データ点の位置に数値を書き込みたい. from Jon, Thanks !
点データを表示する際,その位置に数値を書いておけば,後で数値を読み取 残念ながら,Gnuplotはデータファイルの数値をテキストとして表示するこ 0.40 80 3.00 70 3.00 60 6.00 50 9.00 40 12.00 30 13.00 20 5.00 20 8.00 20 直接gnuplotだけでは出来ないので,まずperlを使って, label gnuplot> set label "(0.4,80)" at 0.4,80 gnuplot> set label "(3.0,70)" at 3.0,70 このような文は,Perlを使って書き出すことができます. % perl -ane 'print "set label \"($F[0],$F[1])\" at $F[0],$F[1]\n"' file.dat > label.plt このようにして作られたgnuplotのコマンドをplot時に読み込めば,データ gnuplot> load "label.plt" gnuplot> plot 'file.dat' u 1:2 smooth csp with lines , > 'file.dat' u 1:2 w points |