|
Revision 966, 1.0 kB
(checked in by alpt, 2 years ago)
|
Initial revision
|
- Property svn:eol-style set to
native
- Property svn:executable set to
*
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
#!/bin/bash |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
which gnuplot &> /dev/null |
|---|
| 5 |
|
|---|
| 6 |
if [ "$?" -ne "0" ] |
|---|
| 7 |
then |
|---|
| 8 |
echo "You must have gnuplot installed" |
|---|
| 9 |
exit 1 |
|---|
| 10 |
fi |
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
echo "Writing the launch script for gnuplot in ganim_launch.gp..." |
|---|
| 15 |
|
|---|
| 16 |
echo "i=0" > ganim_launch.gp |
|---|
| 17 |
echo "set polar" >> ganim_launch.gp |
|---|
| 18 |
echo "set xrange [-5:5]" >> ganim_launch.gp |
|---|
| 19 |
echo "set yrange [-5:5]" >> ganim_launch.gp |
|---|
| 20 |
echo "load \"ganim_script.gp\"" >> ganim_launch.gp |
|---|
| 21 |
|
|---|
| 22 |
echo "This is the written file:" |
|---|
| 23 |
echo "---" |
|---|
| 24 |
cat ganim_launch.gp |
|---|
| 25 |
echo "---" |
|---|
| 26 |
|
|---|
| 27 |
echo "Writing the main gnuplot script in ganim_script.gp..." |
|---|
| 28 |
|
|---|
| 29 |
echo "plot exp(sin(t)) - 2* cos(i*t) + (sin(1/2*(i*t - pi)))" > ganim_script.gp |
|---|
| 30 |
echo "i=i+0.1" >> ganim_script.gp |
|---|
| 31 |
echo "pause 0.05" >> ganim_script.gp |
|---|
| 32 |
echo "if(i < 1000) reread" >> ganim_script.gp |
|---|
| 33 |
|
|---|
| 34 |
echo "This is the written file:" |
|---|
| 35 |
echo "---" |
|---|
| 36 |
cat ganim_script.gp |
|---|
| 37 |
echo "---" |
|---|
| 38 |
|
|---|
| 39 |
echo "Ok, waiting 2 seconds and then launching \"gnuplot ganim_launch.gp\"" |
|---|
| 40 |
echo "To stop the animation hit CTRL+C in the terminal" |
|---|
| 41 |
echo "Now, Enjoy ^_^" |
|---|
| 42 |
sleep 2 |
|---|
| 43 |
gnuplot ganim_launch.gp |
|---|