add a gnuplot/shell script

This commit is contained in:
tTh 2022-12-06 02:38:41 +01:00
parent cc71a55ccb
commit 0abf66fad5
3 changed files with 49 additions and 0 deletions

View File

@ -6,7 +6,10 @@ WS/*.pgm
WS/*.png
WS/*/*.pgm
WS/*/*.png
WS/*/*.gif
WS/data/*
*.png
*.gif
*.log
*.mp4

View File

@ -18,6 +18,10 @@ passer per une recompilation.
Vous vous en doutez, c'est du POVray.
## Sortie graphique
Actuellement, un script pour enrober gnuplot, what else ?
## Conclusion
Enjoy !

42
GravityField/plotation.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
set -e
SRC=WS/data/00013.txt
DST=graph.png
rm WS/graph/*.png
# ----------------------------------------------------------
plot_a_map ()
{
NUMERO=$1
SRC=$(printf "WS/data/%05d.txt" $NUMERO)
DST=$(printf "WS/graph/%05d.png" $NUMERO)
TXT=$(printf "Mass bodies #%05d" $NUMERO)
echo " " $SRC $DST " " $TXT
gnuplot << __EOC__
set term png size 512,512
set xrange [ 0.0 : 1024 ]
set yrange [ 0.0 : 1024 ]
set output "${DST}"
set ytics 256
set xtics 256
set grid front
set title "${TXT}"
plot "$SRC" using 1:2 title "location"
__EOC__
}
# ----------------------------------------------------------
for foo in $(seq 0 8 1999)
do
plot_a_map $foo
done
convert -delay 10 WS/graph/0????.png foo.gif
# ----------------------------------------------------------