imbedded gnuplot script problem
Hello all.
I have embedded a gnuplot script into a .sh by using for i in *.spe do gnuplot << EOF set title "File : $i " set term png set output "${i%.txt}.png" plot [0:22000] 'final.res' u 1: (2*$i), '' u 1: (2*$i+1), '$i.spe' w l unset output set term wxt EOF done exit 1 That obviously doesn't work (please don't laugh at me, I'm aware it can't) because $i is read as i.spe, not the number i. Basically I have about 15000 stellar objets so 15000 graphs to plot. for each of them 1:2i from final.res and i.spe are 2 different theoretical models, and 1: (2i+1) are the observed values. What is the proper way to achieve that? |
Hi,
it's been a long time since I used gnuplot and I'm having a little trouble understanding exactly what you want to do. So, if you could post gnuplot commands that will work for a single file we should be able to show you how to fix the script to run over all your files. Evo2. |
Ooops, sorry not clear.
to get only the 6th (say) graph printed to the file '6.png', I would write: do gnuplot << EOF set title "File : $i " set term png set output "6.png" plot [0:22000] 'final.res' u 1:12, '' u 1:13, '6.spe' w l unset output set term wxt EOF done and for say the 7th graph, the middle lines would change to set output "7.png" plot [0:22000] 'final.res' u 1:14, '' u 1:15, '7.spe' w l does that clarify? :s |
Hi,
ok, I think I understand now. Please try something like the following Code:
#!/bin/bash HTH, Evo2. |
That clarifies many things. Thanks a lot (:
|
All times are GMT -5. The time now is 10:22 PM. |