|
From: DavidH56 <dlh...@co...> - 2011-08-26 04:07:55
|
Hi Thomas,
I'm getting this msg with the latest script:
gnuplot> do for [i=0:m-1] {
^
"cycle4a.txt", line 15: invalid complex constant
Here's the script I'm using; my file is "Generation Data.txt" and I want to
plot column 17. I made minor changes to the lines preceded with "*" (I
removed comments for brevity):
reset
set macros
m=12
* set timefmt "%m-%d-%Y"
set table
n=0
* plot for [i=0:m-1] "Generation Data.txt" \
* using ($0>n?n=$0:0 , $0):17 every m::i
print n
do for [i=0:m-1] {
sum=0
* plot "Generation Data.txt" using 0:(sum=sum+$2 , $2) every m::i
av=sum/n
x=i*(n+1)
set arrow i+1 from x,av to x+n,av nohead lt 1 lc rgb "black"
}
unset table
mn="JanFebMarAprMayJunJulAugSepOctNovDec"
temp="set xtics ("
do for [i=0:m-1] {
if (i>0) {temp=temp.","}
temp=temp.sprintf("\"%s\" %d",substr(mn,3*i+1,3*i+3),n/2+i*(n+1))
}
temp=temp.")"
@temp
# and now the final plot
*plot for [i=0:m-1] "Generation Data.txt" \
* using (tm_mon(timecolumn(1))+$0+i*n):17 \
every m::i \
with linespoints \
lt 7 lc rgb "black"
--
View this message in context: http://old.nabble.com/Can-gnuplot-create-cycle-plots-%28also-called-month-plots%29--tp32276901p32339219.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|