|
From: Jacob G. <jac...@gm...> - 2014-12-07 13:19:03
|
Hi list,
I have several datafiles, which I'd like to plot together on one plot as
smooth lines, but I'd also like to highlight each maximum
With one file, I'm able to do
plot 'file' smooth csplines
stats 'file'
replot file every::STATS_index_max::STATS_index_max notitle
And get what I want.
I tried expanding this with loops:
filenames = "one two three four"
plot for [file in filenames] file.".txt" \
smooth csplines
do for [n=1:4] {
file=word(filenames,n).'.txt'
stats file
replot file every ::STATS_index_max::STATS_index_max notitle
}
This plots the csplines fine, but when replotting, I get four occurrences of
warning: Skipping unreadable file "four"
It seems this is some sort of name conflict by reusing the variable files;
I was able to solve this by using a different variable, but I'd like to
understand what happened.
Even after changing the file name, I don't get four separate maxima.
Instead, I get the maximum from "four" plotted four times.
Is it possible to do this with loops or do I need to write one big plotting
command to do it all at once?
Thanks
Jake
|