~$ ./program < initial_data.dat 1 2 3 4 7 5 8 6
then you make bash do this
#!/bin/bash for((i=0;i<1;i++)) do echo "plot '-' u 1:2" echo "./program < initial_data.dat" | bash echo "e" done | gnuplot -persist echo "Finished!"
Example. I don't really have a program to show you this and, honestly, I don't want to do it, so I will use bash directly to plot something with gnuplot. Let's try to create an animated gif on gnuplot for a sinus varying its wavelength.
#!/bin/bash for((i=0;i<1;i++)) do echo "set term gif animate delay 40 enhanced;" echo "set output \"sin_out.gif\";" for ((k=0;k<11; k++)) do echo "plot sin($k*x)" done done | gnuplot -persist echo "Finished!"
No comments:
Post a Comment