Key features: 

histogram/bar plot, overlapping histograms, superscripts, multiple figures in single output image ("multiplot"), text within image ("labels"), constant function (e.g. f(x)=c), difference function, publication quality, PNG file output

This image is Fig. 3 from my second publication

reset 

set terminal png truecolor nocrop enhanced font "arial,80" size 3078,4608  ## good ratio for publication: 1.336

set output "fig3-v3.png" ## output filename


set multiplot layout 2, 1 title ""

set tics scale 2.5

unset grid ## alternatively, use "with lines" after "plot"

set samples 10000 ## default=100... improves smoothness

set border 15 lw 9

set key samplen .05

set key spacing .45

set key nobox at 292, 78.5 ## puts legend in upper-right corner

set pointsize 9 


iapwse(x) = B*((1-(x/Tc))**mu)*(1+b*(1-(x/Tc)))+exp(C*(x-Te))

b  =  -0.62435

B  = 235.697

C  =  -0.11627

Te = 234.669

mu =  1.256

Tc = 647.096


iapws(x) = BB*((1-(x/tctc))**mumu)*(1+bb*(1-(x/tctc)))

BB = 235.8

bb =   -.625

mumu =   1.256

tctc = 647.096




### PLOT 1 ###

set lmargin 5.5

set label "a" at graph .88,.85 center font "arial bold,80"

set xlabel "Temperature (K)" offset 0,.5

set ylabel "Difference from IAPWS fit (mN{\267}m^{-1})" offset 3.5,0

set tics scale 2.5

set xtic 200,10,350 offset 0,.1 nomirror ## this is the spacing between tics on the x-axis

set mxtics 2 ## this sets the frequency of the MINOR x-tics;

set ytic -10,.1,90 offset .75,-.25 nomirror ## this is the spacing between tics on the y-axis

set mytics 2 ## this sets the v of the MINOR y-tics

set xrange [245:294]

set yrange [-.15:.4]

set key nobox at 291.5, .3 ## puts legend in upper-right corner


zero(x) = 0 


set bars small

plot zero(x) lc rgb "blue" lw 10 notitle, \

"iapws2014_hrubyt1.dat" u 1:($2-iapws($1))   pt 12 lt -1 lw 10 title "experiment", \

  (iapwse(x) - iapws(x)) lc rgb "red" lw 10 title "IAPWS-E", \

"fig3.dat" u 1:((iapwse($1)-iapws($1))+($4)):5 with xerrorbars  pt 0 lc rgb "black" lw 14 notitle, \

"fig3.dat" u 1:((iapwse($1)-iapws($1))-($4)):5 with xerrorbars  pt 0 lc rgb "black" lw 14 notitle



unset label

unset lmargin

### END OF PLOT 1 ###




### PLOT 2 ###

set style fill transparent border


#------   HISTOGRAM   ------------------

width=.0325 ## bin width

set boxwidth width*.875 ## width of visual column; mathematical binwidth defined above

set format x "%1.2f" ## x-values allowed 0.000 digits

set xtics -100*width,4*width,100*width offset 0,.25 out nomirror ## this is the spacing between tics on the x-axis

set xrange [-.31:.31] ## options: "[min:max]" , "[:]" is "perfect" range,

set yrange [0.1:16]

set key nobox at .29, 14       ## where to put legend: x, y

#---------------------------------------

set label "b" at graph .88,.85 center font "arial bold,80"

set xlabel "Deviation from model equation (mN{\267}m^{-1})" offset 0,.5

set ylabel "Frequency" offset 2.5,0

set mxtics 2 ## frequency of the MINOR x-tics;

set ytic 0,2,50 offset .75,-.25 nomirror ## spacing between tics on the y-axis

set key spacing .5

set key samplen .09

set key nobox at .28, 13.5 ## puts legend in upper-right corner

set pointsize 8 


## function used to map a value to the intervals:

START = width/2

bin(x) = width*(floor((x-START)/width)+0.5) + START


plot "h1-h2-p1-p2-prague-s.dat" u (bin($2-iapws($1))):(1)   smooth freq w boxes lc rgb "blue" lw 4 fs solid .75 title "IAPWS", \

     "h1-h2-p1-p2-prague-s.dat" u (bin($2-iapwse($1))):(1) smooth freq w boxes lc rgb "red"  lw 10 title "IAPWS-E"


unset label

### END OF PLOT 2 ###



unset multiplot


##################

# pointtype ("pt")

#  0 = none

#  1 = horz.line

#  2 = X

#  3 = X & horz.line

#  4 = open box

#  5 = closed box

#  6 = open circle

#  7 = closed circ.

#  8 = open up triang.

#  9 = closed up triang.

#  13= solid diamond

#  12= open diamond



# linetype ("lt")

# -1 = black

#  0 = grey dotted

#  1 = purple

#  2 = green

#  3 = sky blue

#  4 = orange

#  5 = yellow

#  6 = navy blue

#  7 = red