################ # グラフの種類 # ################ reset set encoding utf8 set terminal svg enhanced size 600,400 font "Arial:Bold,12" # svg # set terminal pdf enhanced size 5in,3in font "Arial:Bold,12" # pdf # set terminal png size 900,600 font "Arial,14" # png data1 = "inputfile1.dat" set output "out.svg" # --- PARAMETRIC --- # http://ayapin-film.sakura.ne.jp/Gnuplot/Primer/parametric.html # set parametric # --- POLAR --- # http://ayapin-film.sakura.ne.jp/Gnuplot/Primer/polar.html # set polar # --- 3D PLOT --- # set xyplane at 0 # <- position of xy-plane in z axis # set hidden3d # 図形の向こうのborderなどを隠す # set contour # 等高線 https://atatat.hatenablog.com/entry/gnuplot19_contour # --- HEATMAP --- # set pm3d map interpolate 0,0 # set palette rgbformulae 22,13,-31 ################ # 枠の調整 # ################ # ---BORDER/AXIS --- set border unset zeroaxis # xzeroaxis, yzeroaxis # ---RATIO --- # https://miyabi-mathematics.hatenablog.com/entry/2017/01/15/202207 # http://dsl4.eee.u-ryukyu.ac.jp/DOCS/gnuplot/node105.html set size ratio 2/(sqrt(5)+1) # 1:(y/x), -1 for 1:1 axes # --- MARGIN --- set lmargin 3 set rmargin 0 set tmargin 2 set bmargin 2 # unset margin # --- GRID --- # set nogrid # set grid polar pi/6 # polar # set grid x y z vertical # 3D set grid linetype 1 linewidth 0.75 linecolor "gray" # --- AXIS: x, x2, y, y2, z, cb, r, t, u, v --- # FONT OFFSET ROTATION set title font ",16" offset 0,-1 rotate by 0 center set xlabel font ",14" offset 0,1.0 rotate by 0 center # 3D: parallel set ylabel font ",14" offset 2.0,1.0 rotate by 90 center # 3D: parallel # set x2label font ",14" offset 3,0.5 rotate by 0 center # set y2label font ",14" offset -5,0.5 rotate by 0 center # set zlabel font ",14" offset 3,0 rotate by 0 center # 90 set xtics font ",12" offset -0.0,0.5 rotate by 0 nomirror set ytics font ",12" offset 0.1,0 rotate by 0 mirror # set x2tics font ",12" offset 0,0 rotate by 0 nomirror # set y2tics font ",12" offset 0.1,0 rotate by 0 nomirror # set ztics font ",12" offset 2,0 rotate by 0 nomirror # --- TICS --- # set tics scale 1, 0.5 # default: 1, 0.5 # set tics in # or out # --- REPRESENTATION --- # http://ayapin-film.sakura.ne.jp/Gnuplot/Primer/tics_label.html # 表示形式の例 # set format x "%h" # default format set format x "%.0Pπ" # 0π 1π 2π 3π ... # set format y "%2.0t x 10^{%T}" # 13 x 10^{5} etc. # set format y2 "%5.2f" # 23.44 etc. # set format z "10^{%L}" # 10^{3}, e^{4} etc. # --- LOGSCALE --- # 対数の場合はmticsが使えない # set logscale x 10 # set logscale y 10 # set logscale x2 10 # set logscale y2 10 # set logscale z 10 # 横軸の微細化. log や exp など急峻な関数に, 計算量が爆発するので10^6 まで set samples 200 # default: 100 ################ #定数,変数,関数# ################ # --- trigonometry --- set angles radians # or angles # linear fitting example # F(x) = A0 * x + B0 # fit F(x) data0 using 1:2 every ::1::86 via A0, B0 # Ftitle = sprintf("F(v) = %2e v + %3f ", A0, B0) # set label 1 sprintf(Ftitle) at -100,6 left f(x) = sin(x)/x g(x) = (x*cos(x)-sin(x))/x**2 # f'(x) ################ # 実際の表記 # ################ # key: http://dsl4.eee.u-ryukyu.ac.jp/DOCS/gnuplot/node96.html set title "example" set key left top # at x,y; L/R outside; above/below set key box linestyle -1 linewidth 0.75 linecolor rgb "gray" set key title "凡例" font ",12" # or notitle set key spacing 1.2 width -3 height 0 set key Left reverse # Right/Left jusfitied text # set nokey # --- X AXIS --- set xlabel "{/:Italic x}" set xrange [-3*pi:3*pi] noreverse set xtics () set for [i=-3:3] xtics add (i*pi) # set mxtics 5 # unset for logscale # --- Y AXIS --- set ylabel "{/:Italic y}" set yrange [-0.5:1.1] noreverse set ytics -0.4, 0.2, 1.0 # ("face1" pos1, ..., "faceN" posN) set mytics 2 # unset for logscale # --- Y AXIS II --- # set y2label "" # set y2range [-1:1] noreverse # set y2tics -1, 0.1, 1 # ("face1" pos1, ..., "faceN" posN) # set my2tics 5 # unset for logscale # --- Z AXIS (3D) --- # set zlabel "" # set zrange [-1:1] noreverse # set ztics -1, 0.1, 1 # ("face1" pos1, ..., "faceN" posN) # set mztics 5 # unset for logscale ################ # 自由記述 # ################ # set arrow 1 from -5,0 to 185,0 nohead lt 0 lw 2 # set arrow 2 from f2,0.08 to f2,100 nohead lc rgb "forest-green" lw 2 # set arrow 3 from f3,0.08 to f3,100 nohead lc rgb "forest-green" lw 2 # set label 1 sprintf("2D growth") at 0.1,840,4 left # set label 2 sprintf("810 deg.C") at 0.927,0.17 left # set label 3 sprintf("700 deg.C") at 1.024,0.315 right ################ # PLOT # ################ # lines / points / linespoints // impulses / boxes / steps / fsteps / hsteps # linetype: 色 -1:black, 1:purple, 2:green, 3:skyblue, 4:yellow, 5:gold, 6: darkblue # pointtype: 形 1:+, 2:x, 3:star, 4:sq, 5:sq-fill, 6: circle, 7:circle-fill, tri, downtri, diamond, penta # splot \ # for 3D plot \ f(x) with lines linetype 1 linewidth 2 title "sin(x)/x" , \ g(x) with lines linetype 2 linewidth 2 title "d/dx sin(x)/x" # , \