Plot several files

View: New views
2 Messages — Rating Filter:   Alert me  

Plot several files

by arvindmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have 100 data files named as 1.0.dat, 1.5.dat ..... 99.5.dat, 100.0.dat
I want a gnuplot script to plot then in different ps (post script) files (100 ps files).
Plz help
Thanks in advance ....

Re: Plot several files

by atomman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I usually use tcl as my prefered scripting language but any other would do. Then I prepare a script like:

proc plotPS  {name f} {

set plot [open $name.gnu w]
set term enhanced postscript
set output "$name.ps"
set yrange \[0:360\]
set xrange \[0:45\]
splot \\"
puts -nonewline $plot "
'$f' using 2:1:3
"
close $plot
exec gnuplot $name.gnu
}

for {set i 1} {$i<100} {incr i 0.5} {
plotPS  $i $i.dat
}



arvindmer wrote:
I have 100 data files named as 1.0.dat, 1.5.dat ..... 99.5.dat, 100.0.dat
I want a gnuplot script to plot then in different ps (post script) files (100 ps files).
Plz help
Thanks in advance ....