add a gnuplot/shell script
This commit is contained in:
parent
cc71a55ccb
commit
0abf66fad5
3
GravityField/.gitignore
vendored
3
GravityField/.gitignore
vendored
@ -6,7 +6,10 @@ WS/*.pgm
|
||||
WS/*.png
|
||||
WS/*/*.pgm
|
||||
WS/*/*.png
|
||||
WS/*/*.gif
|
||||
WS/data/*
|
||||
|
||||
*.png
|
||||
*.gif
|
||||
*.log
|
||||
*.mp4
|
||||
|
@ -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
42
GravityField/plotation.sh
Executable 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
|
||||
|
||||
# ----------------------------------------------------------
|
Loading…
Reference in New Issue
Block a user