gnuplot - eiichiromomma/CVMLAB GitHub Wiki

gnuplot

gnuplotでの作業メモ

#等高線図(contour map)の色々

サンプルデータ

sin*cos

  0.140   0.059  -0.076  -0.141  -0.076   0.059   0.140
  0.900   0.378  -0.491  -0.909  -0.491   0.378   0.900
  0.833   0.350  -0.455  -0.841  -0.455   0.350   0.833
  0.000   0.000   0.000   0.000   0.000   0.000   0.000
 -0.833  -0.350   0.455   0.841   0.455  -0.350  -0.833
 -0.900  -0.378   0.491   0.909   0.491  -0.378  -0.900
 -0.140  -0.059   0.076   0.141   0.076  -0.059  -0.140

sincos.prnとして保存

出力

matrixのプロット

set hidden3d offset -1
splot "sincos.prn" matrix with lines linetype 2

等高線のプロット

unset key
unset surface
set contour base
set view map
splot "sincos.prn" matrix with lines linetype 2

等高線を3次のbsplineで

unset key
unset surface
set contour base
set view map
set cntrparam order 3
set cntrparam bspline
splot "sincos.prn" matrix with lines linetype 2

カラーマップで

unset contour
unset key
unset surface
set view map
set pm3d at b
splot "sincos.prn" matrix with pm3d

補完したカラーマップ

unset contour
unset key
unset surface
set view map
set pm3d at b
set pm3d interpolate 10,10
splot "sincos.prn" matrix with pm3d

任意のレベルの等高線

unset key
unset surface
unset pm3d
set contour base
set view map
set pm3d at b
set cntrparam order 3
set cntrparam bspline
set cntrparam levels discrete -0.3,0.1,0,0.2,0.8
splot "sincos.prn" matrix with lines linetype 2