I have this dataset:
| x-axis | y-axis | y2-axis |
|---|---|---|
| 15 | 9.585 | 88.38 |
| 45 | 9.4185 | 86.85 |
| 60 | 9.2655 | 85.44 |
I want to produce plot that two different y-axis in gnuplot, which is dependable each other
But, I troubled to adjust the second y-axis to the first one
As you can see from the graph and dataset, the value of each points didn't exactly same from the dataset, it's just like the y2-axis just plotted there, without even adjusted to the values in dataset.
Is it possible to produce such graph?
Here's my code I worked before:
set xrange [5:70]
set yrange [9.1:9.7]
set y2range [85:89]
unset key
set xtics 15 font ",18" nomirror
set xlabel "x-axis" font ",24"
set xlabel offset 0,-.5
set ytics .2 font ",18" nomirror
set ylabel "y-axis" font ",24"
set ylabel offset -1.5
set y2tics font ",18"
set y2label "y2-axis" font ",24"
plot "Dataset.txt" with linespoints ls 1
Please check
help link. You can define a function (and the inverse of it) if you want to link axes.From your numbers I guess that the relation between your y1-axis and y2-axis is simply a factor of
9.221.Script:
Result: