0

I'm trying to create a plot which has two independent y-axes on the left hand side, i.e. sharing the same x-axis. Is this possible in Gnuplot? I'm aware that it can be done with python for example.

Karl
  • 2,117
  • 13
  • 26
jamesd
  • 1
  • 1
  • please see this thread for an example: http://stackoverflow.com/questions/20146652/two-y-axis-on-the-left-side-of-the-figure – jamesd Nov 06 '15 at 13:12

1 Answers1

1

You can just do the plot on gnuplot's standard x1y1 and x1y2 axes, and then add the extra axis with multiplot.

This example here is not perfect, but should give you an idea how to do it. As Christoph said, it's a bit fiddly:

set multiplot
set lmargin at scr 0.2
set bmargin at scr 0.1 # fix bottom margin
set y2range [0:20]     
plot x, 2*x axes x1y2  # this is your actual plot

set lmargin at scr 0.1
set yrange [0:20]    # set yrange to the same as y2 in the first plot
set border 2         # switch off all borders except the left   
unset xtics          # switch off the stray xtics
plot -1000 notitle   # plot something outside of the y(2)range
unset multi
Karl
  • 2,117
  • 13
  • 26