frackers
frackers

Reputation: 21

gnuplot script fails - has there been a change in defaults from 4.4 to 4.6

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?

Upvotes: 0

Views: 172

Answers (2)

J M
J M

Reputation: 1

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

Upvotes: 0

frackers
frackers

Reputation: 21

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

Upvotes: 2

Related Questions