How to plot and save many data files in GNUPLOT, inside a loop in a SHELL SCRIPT

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 5K views
alice06
Messages
6
Reaction score
0
Hi all
I badly need some help...

I plot a file output1.txt in the following way ::

Code:
gnuplot> plot "output1.txt" using 1:2 with lines, \
plot "output1.txt" using 1:3 with lines

BUT now I have many data files,

Code:
output1.txt, output2.txt, output3.txt, ...,... ,output1000.txt

I need to plot each one of them in gnuplot, and save them respectively in

Code:
graph1.jpeg, graph2.jpeg, graph3.jpeg, ..., graph1000.jpeg


It is very cumbersome if I plot and save 1 file at a time.

Is there an easy way, using loops in a Shell script that can PLOT and SAVE them

Please kindly help
Regards
Alice
 
Physics news on Phys.org