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.
Asked
Active
Viewed 493 times
1 Answers
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