Key features:
Angstrom symbol, special character, dotted lines/dashed lines, two ordinate axes in same figure/different left and right axes, truncated axes, axes or tick marks that do not span the figure edge, partial tick marks, get plot data from file, get data from different folder/directory, mathematical manipulation of input data, publication quality
This image is Fig. 5 from my fifth publication.
This figure has a few useful features that can be tricky to learn in gnuplot:
This figure shows two sets of curves-- each set with its own ordinate axis. This is achieved by using the familiar ylabel, ytics, and yrange keywords for the lefthand ordinate axis; and the special keywords y2label, y2tics, and y2range for the additional/righthand ordinate axis. In addition, I used set multiplot layout 1,1 to get gnuplot to let me use two plot statements while plotting both outputs on the same figure space.
For those of you simply looking for the Angstrom symbol, the gnuplot code for it is \305.
reset # good idea to make sure you start "fresh"
set terminal pngcairo truecolor nocrop enhanced font "arial,80" size 3200,2300 # good ratio for publication: 1.336
set output "all_RDF_C1-OW_C1-HW_v5.png" # output filename
set multiplot layout 1,1 title ""
## SETTINGS FOR WHOLE PLOT
unset grid # turn off background gridlines in plot
set samples 10000 # default=100... improves smoothness
set border 15 lw 9 #
set tics scale 1.25 # length of tic marks around plot frame/box
set pointsize 4
set bars 1.0 # default=1.0
## SETTINGS FOR HORIZONTAL AXIS=ABSCISSA
set xlabel "r (\305)" offset 0,.5 # horizontal, abscissa label
set xrange [2:9] # options: "[min:max]" , "[:]" is "perfect" range,
#set xtics 0,.5,10
set xtics offset -.25,.25 #out nomirror # this is the spacing between tics on the x-axis
set mxtics 2 # frequency of the MINOR x-tics;
## SETTINGS FOR VERTICAL AXIS=ORDINATE
set ylabel "C1-OW RDF" offset 1,-2. # vertical, ordinate label
set yrange [0:2.7] # options: "[min:max]" , "[:]" is "perfect" range,
set ytics -19,0.5,2
set ytic offset .25,0 nomirror # spacing between tics on the y-axis
set mytics 2 # frequency of the MINOR x-tics;
set y2label "C1-HW RDF" offset -3,+2.5 # vertical, ordinate label
set y2range [-1:1.7] # options: "[min:max]" , "[:]" is "perfect" range,
set y2tics 0,0.5,20
set y2tic offset -.75,0 nomirror # spacing between tics on the y-axis
set my2tics 2 # frequency of the MINOR x-tics;
## SETTINGS FOR KEY/LEGEND
set key spacing 1 # vertical spacing between legend lines.
set key width 5 # horizontal span of legent; affects legend column spacing.
set key samplen .25 # length of line sample shown in legend
set key maxrows 7 # can force number of rows/columns in legend
#set key nobox bottom right #
set key nobox at graph 0.95,0.325
set key font "arial,80" # special font and fontsize only for legend.
#set label "C1-OW" at graph .15,.95 #textcolor rgb "gray50" # font "arial bold,80"
#set label "plots stacked at g=0" at graph .5,.95 #textcolor rgb "gray50" # font "arial bold,80"
#set label "\\\& shifted from g=1" at graph .5,.87 #textcolor rgb "gray50" # font "arial bold,80"
plot \
"RDF_methane/rdf_C1-OW.xvg" every 2 u ($1*10):($2+0) w lines lw 10 title "methane",\
"RDF_ethane/rdf_C1-OW.xvg" every 2 u ($1*10):($2+0) w lines lw 10 title "ethane",\
"RDF_methanol/rdf_C1-OW.xvg" every 2 u ($1*10):($2+0) w lines lw 10 title "methanol",\
"RDF_ethanol/rdf_C1-OW.xvg" every 2 u ($1*10):($2+0) w lines lw 10 title "ethanol"
plot \
"RDF_methane/rdf_C1-HW.xvg" every 2 u ($1*10):($2+1) w lines dt "-" lw 10 title "",\
"RDF_ethane/rdf_C1-HW.xvg" every 2 u ($1*10):($2+1) w lines dt "-" lw 10 title "",\
"RDF_methanol/rdf_C1-HW.xvg" every 2 u ($1*10):($2+1) w lines dt "-" lw 10 title "",\
"RDF_ethanol/rdf_C1-HW.xvg" every 2 u ($1*10):($2+1) w lines dt "-" lw 10 title ""
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.
# 10= open down triang.
# 11= closed down triang.
# 12= open diamond
# 13= solid diamond
# linetype ("lt")
# -1 = gray50
# 0 = grey dotted
# 1 = purple
# 2 = dark-cyan
# 3 = sky black
# 4 = dark-chartreuse
# 5 = yellow
# 6 = navy black
# 7 = red
# \305 = Angstrom
# {/Symbol *} = Greek *
# {/Symbol \250} = poker diamond