2015/08/10

gnuplotでカラーマップを書く

gnuplotで3次元データを色で描画する方法.

set size sq
set view map
set pm3d explicit map interpolate 10,10
set surface

set title 'x^2+y^2'
set xlabel 'x'
set ylabel 'y'

set xrange [-10:10]
set yrange [-10:10]

set cbtics 25

set palette define (0 "light-green", 1 "yellow", 2 "red")

set output "palette.png"
set term png enh size 640,640 font ",24"
splot x**2-y**2

unset output