I am plotting the creation times of a large batch of files in gnuplot to see if they are created linearly in time (they are not).
Here is my code:
#!/bin/bash
stat -c %Y img2/*png > timedata
echo "set terminal postscript enhanced colour
set output 'file_creation_time.eps'
plot 'timedata'" | gnuplot
The problem I have is that the y data are the creation time in seconds since unix start time, so the plot just has 1.333...e+09 on the y-axis. I would like to have the creation time of the first file scaled to zero so that the relative creation times are readable.
I encounter this problem in a number of data-plotting contexts, so I would like to be able to do this within gnuplot rather than resorting to awk or some utility to preprocess the data.
I know the first time will be the smallest since the files are named serially, so is there a way to access the first element in a file, something like
`plot 'data' using ($1-$1[firstelement])`
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…