I want to plot a graph with gnuplot and the idea is that I will have a dataset, which I will plot form left to right and after that, plot the same data multiplied by 1.3 or something from right to left and once more plot the original data multiplied by 0.7 again from left to right.
This is my working code for the first plot from left to right, but I have no idea how to make it plot the remaning two. Variable DATA is the data file.
LINES=$(wc -l <"$DATA")
YRANGE=$(sort -n "$DATA" | sed -n '1p;$p' | paste -d: -s)
FMT=$TMPDIR/%0${#LINES}d.png
for ((i=1;i<=LINES;i++))
do
{
cat <<-PLOT
set terminal png
set output "$(printf "$FMT" $i)"
plot [0:$LINES][$YRANGE] '-' with lines t ''
PLOT
head -n $i "$DATA"
} | gnuplot
done
Can you please give me some hints ? Thank you very much