Monday 22 June 2020

Separate y-axis on the right

If you want to have two independent y-axis – one on the left, and one on the right – you can unset the mirroring of the "main" left-hand y-axis marks with set ytics nomirror, and use axis x1y2 in the plot command to use the right-hand y-axis.  See the following example for a basic unembellished example

gnuplot> set y2tics
gnuplot> set ytics nomirror
gnuplot> set ylabel "Energy [MeV]"
gnuplot> set y2label "{/Symbol b}_2"
gnuplot> set termopt enh
gnuplot> set xlabel "index"
gnuplot> plot 'ensurf.all' u 0:13 w l t "Binding Energy", '' u 0:4 axis x1y2 w l t "deformation ({/Symbol b}_2)"


and the result is shown in the screengrab below


No comments:

Post a Comment