0

The following script to plot data from my wind turbine worked fine in version 4.4 but now fails with

"plots", line 14: could not find column with header "11"

Something seems to have changed with variable substitution but I can't find it documented.

# data format
# 13-02-13 13:42:00 E:0 L:0 S:1 F:9 D:44 T:20.91 C:997 V:28.02 A:2.85 P:79 R:219 r:292 H:223 Y:1057 h:-225 y:-1228 I:5249 O:4921
# command line
# gnuplot -e "filename='log-130213.txt'; f1='11'; t1='Volts'; f2='14'; t2='RPM'" plots
set title filename
set datafile separator ":"
set xdata time
set timefmt "%d-%m-%y %H:%M:%S"
set format x "%H:%M"
set xlabel "Time"
set ylabel t1
set y2label t2
set y2tics
plot filename using 1:f1 with line title t1 axis x1y1 , "" u 1:f2 with line title t2 axis x1y2
pause -1

Anyone any ideas?

frackers
  • 21
  • 1
  • SOLVED: Changing the command line to NOT quote the numeric value of the column required corrects the problem. With the quotes, gnuplot looks for a column header containing '11' or '14' (in my case!!) with no way to turn this facility off! gnuplot -e "filename='log-130213.txt'; f1=11; t1='Volts'; f2=14; t2='RPM'" plots Note: This is a change in behaviour from version 4.4 to version 4.6 – frackers Mar 19 '13 at 00:52
  • Oh bother -- It looks like you already figured this out. If you post this as a solution (rather than a comment) and notify me, I'll gladly delete my answer. – mgilson Mar 19 '13 at 01:40

2 Answers2

2

Answering my own question (after lots of hair pulling)... Changing the command line to NOT quote the numeric value of the column required corrects the problem. With the quotes, gnuplot looks for a column header containing '11' or '14' (in my case!!) with no way to turn this facility off!

gnuplot -e "filename='log-130213.txt'; f1=11; t1='Volts'; f2=14; t2='RPM'" plots 

Note: This is a change in behaviour from version 4.4 to version 4.6

frackers
  • 21
  • 1
0

The problem seems to be that 4.6 is stricter than 4.4 with Var Types. You can, just before the 'plot' command force the string variable to become a numeric variable by doing var=var*1 or within the using command with 'using x*1:y*1:label*1' This saves messing with shell scripting and puts it near to where it is required for programming clarity

J M
  • 1