mcastorina / graph-cli

Flexible command line tool to create graphs from CSV data
783 stars 29 forks source link

xlimit #14

Closed mcastorina closed 5 years ago

mcastorina commented 6 years ago

plot all points where x <= xlimit

I can see this being useful for easily creating videos of the graph quickly

mkdir imgs
for i in $(seq 1000); do
    filled=$(printf "%04d" $i)
    graph samples/sine.csv --marker '' --limit $i -o "imgs/img${filled}.png"
done
ffmpeg -r 15 -i imgs/img%04d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4
rm -rf imgs

although assuming the xcol is sorted in the file, the same can be accomplished with

mkdir imgs
for i in $(seq 2 1002); do
    filled=$(printf "%04d" $i)
    head $i samples/sine.csv | graph - --marker '' -o "imgs/img${filled}.png"
done
ffmpeg -r 15 -i imgs/img%04d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4
rm -rf imgs
mcastorina commented 6 years ago

actually, that does not run quickly ^^

mcastorina commented 5 years ago

although this is trivial to implement, I won't be including it because the same effect can be accomplished using --xrange and --yrange