plot
******************
#interactive mode
gnuplot> load "plot"
#change working directory under interactive mode
gnuplot> cd "./Fig/"
#batch mode
gnuplot plot
******************
can not open X11 window from remote server? do -X during ssh:
ssh -X user@host
set term post eps enh # set ouput format
set output "filename.eps" # set output file name
set size 0.7,0.7
set origin 0,0
set border -1 lw 0.5 # set number and thickness of the figure frames
set pointsize 1.0
set multiplot
set key samplen X #default is 4
set key spacing X #default is 1.25
set key top left
set size 0.7, 0.7
set origin 0,0.0
#set format y "%.1f"
#set format y2 "%.1f"
#set tmargin 10
set label '{/Symbol \341}2{/Symbol \361}' at 2.6,-3.45
set label '(a)' at 4.02,-3.18 rotate by 90
set log xy # double log scale
set tics scale 0.5 # change tics length
set xlabel "X"
set xrange[2.2:4.2]
set xtics 2.2,0.4,4.4
set mxtics 2
set arrow from 1,0 to 1,3 lc 1 lt 1 lw 2 nohead
set yrange[-3.5:-2.7]
set ylabel 'Y1'
set ytics -2.8,-0.2,-3.4
set mytics 2
set ytics nomirror # do not show ytics on the right axis
set ytics ("10^{-3}" 0.001, "" 0.002, "" 0.003, "" 0.004, "10^{-2}" 0.01)
set x2range[2.2:4.2]
set y2range[-2.65:-0.85]
set y2label 'Y2'
set y2tics -1,-0.5,-2.5
set my2tics 2
plot 'data' us 1:2 title 'curve 1' with lines lt 10 lw 0.5,\
'data' us 1:2 notitle with points pt 1 ps 1,\
'data' us 1:2 notitle smooth csplines lt 1 lw 1,\
'data' us 1:2 notitle smooth bezier lt 1 lw 1,\
'data' us 1:3 notitle with lines lt 10 lw 0.5 axes x2y2
# make a second plot as inset
set size 0.2,0.2
set origin 0.01,0.02
#unset tmargin
unset xlabel
unset xtics
unset ylabel
unset y2label
unset ytics
unset y2tics
unset label
unset key
set format x "" # do not show x tics
set key 0.5,0.5
set yrange[-1:1]
plot 'data2' us 1:2 notitle with lines lt 1 lw 0.5
#pause -1 "Hit return to continue"
set key {on|off} {default} {{inside | outside} | {lmargin | rmargin | tmargin | bmargin} | {at <position>}} {left | right | center} {top | bottom | center} {vertical | horizontal} {Left | Right} {{no}reverse} {{no}invert} {samplen <sample_length>} {spacing <vertical_spacing>} {width <width_increment>} {height <height_increment>} {{no}autotitle {columnheader}} {title "<text>"} {{no}enhanced} {{no}box { {linestyle | ls <line_style>} | {linetype | lt <line_type>} {linewidth | lw <line_width>}}} unset key show key
bin = 0.1;
plot 'data.dat' u (bin*(floor($2/bin))):(1.0) smo freq
#plot data from two columns? First combine two files row by row.
paste x_data.dat y_data.dat > xy_data.dat
#color convention
https://stackoverflow.com/questions/19412382/gnuplot-line-types
set colorsequence default|podo|classic