#!/bin/bash # Graph animation of input data # Prepare separate frames # For each frame for (( i=1; i<=1000; i++ )) do # Prepare data # Run gnuplot to make single frame ( cat test.plot head -n "$i" data ) | gnuplot # Rename frame according to frame # mv out.png $( printf "%03d" "$i" ).png done # Join frames into animation ffmpeg -i %03d.png anim.mp4 #Cleanup rm *.png