Plotting relative to a fixed data element
-
19-09-2019 - |
Question
I have the following datafile:
x y
1 50.583
2 27.842
3 19.156
4 15.491
6 9.779
8 8.584
12 6.436
16 4.595
24 3.605
32 2.447
I want to plot the points (xi, yi / y1). How do I do this using gnuplot?
Solution
I think I figured out a solution using shell scripts:
#!/bin/sh
base=`head -n1 input.txt | cut -f2 -d' '`
gnuplot << EOF
plot input.txt using 1:(\$2 / $base)
EOF
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow