gnuplot / plot (6)
not so FAQ
|
2次元プロットのあれこれ (その6)表示方法の異なる2つの図を横または縦に並べる. 同じデータの図を,表示方法を変えて,横または縦に並べる方法を紹介します.
同じデータを表示スケールを変えて横に並べる. 左のようなデータがあるとします.ここでの表示範囲は,[0:30]となってい gnuplot> set log xy gnuplot> set xrange [ 0.001 : 1 ] gnuplot> set yrange [ 0.1 : 5000 ] gnuplot> set xlabel "Energy [eV]" Xが[1:30]の領域はlinear scaleで表示し,1以下の対数表示の図の横に 左側の図にはY目盛を入れるため, set lmargin 10 としてY軸の gnuplot> set multiplot multiplot> set size 0.5,1 multiplot> set origin 0.0,0.0 multiplot> set lmargin 10 multiplot> set rmargin 0 multiplot> plot "calc.dat" u 1:2 w l multiplot> set origin 0.5,0.0 multiplot> set format y "" multiplot> set lmargin 0 multiplot> set rmargin 2 multiplot> set nolog x multiplot> set xrange [1:30] multiplot> set xtic 0,10 multiplot> set mxtic 5 multiplot> plot "calc.dat" u 1:2 w l multiplot> set nomultiplot gnuplot> 左側と右側のスケールが違うことを明確にするために,X軸にはminor tics 実は,このデータはXが小さい場合にlog-logで直線になることが分かってい この例ではX軸名が2つ表示されますが,2つの図の真中近辺に1つだけ表示さ 2つの似通ったデータを絶対値と比で比較する. 非常に似通った2つのデータを比較検討するには,絶対値での比較の他にそ 2つのデータのX座標を揃えておかないと,比を計算することはできませんの 最初に設定するのは,上下の図に共通なX軸関係のパラメータです.ここで gnuplot> set xrange [ 0.01 : 30 ] gnuplot> set nokey gnuplot> set log x gnuplot> set xtics 10 gnuplot> set mxtics 10 gnuplot> set lmargin 10 gnuplot> set rmargin 2 まず下側の図を作ります.下には2つのデータの比をとったものを,縦サイ gnuplot> set multiplot multiplot> set yrange [ 0.5 : 1.5 ] multiplot> set ytic 0.6,0.2,1.4 multiplot> set ylabel "Ratio" multiplot> set size 1,0.4 multiplot> set xlabel "Energy [eV]" multiplot> set origin 0.0,0.0 multiplot> set bmargin 3 multiplot> set tmargin 0 multiplot> plot 1 w l 0,"cross.dat" u 1:($2/$3) w l 1 次に上半分を作ります.下と同様にサイズを縮小した後,下の図の左上に移 multiplot> set log xy multiplot> set yrange [ 0.1 : 5000 ] multiplot> set ytic 0.1,10 multiplot> set ylabel "Cross Section [b]" multiplot> set size 1,0.6 multiplot> set origin 0.0,0.4 multiplot> set bmargin 0 multiplot> set tmargin 1 multiplot> set format x "" multiplot> set xlabel "" multiplot> plot "cross.dat" u 1:2 w l,"" u 1:3 w l multiplot> set nomultiplot gnuplot> ここでは凡例を消していますので,比のデータがA/Bなのか,B/Aなのかはす EPSに出力した完成品がGalleryにあります. |