|
From: Ethan A M. <merritt@u.washington.edu> - 2005-06-28 16:06:35
|
On Tuesday 28 June 2005 08:34 am, Hans-Bernhard Br=F6ker wrote: > Taro Sato wrote: > > > > f(x) =3D x > > fdat =3D 'xy.dat' > > plot f(x), fdat u 1:2 > > "plot.nogood.gp", line 4: warning: encountered a string when expecting > > a number "plot.nogood.gp", line 4: NB: you cannot plot a string-valued > > function > > This is not exactly a bug, but a known syntactical limitation. The way > around it is to drop the parser a hint that fdat is meant to be a > string, not a number, like this: > > plot f(x), ''+fdat u 1:2 # or was that ''.fdat ? The string concatenation operator is . so the hint would be ''.fdat However, I think this really is a bug. `plot f(x)` and `plot fdat` both work individually; it is only the combination of the two that triggers an error message. That should be fixable. I suspect that whatever causes this will also turn out to explain a problem in one of Juer= gen Wieferink's patches. The difficult case (which this is not an example of) is distinguishing a user-defined function that returns the name of a file from a user- defined function that returns a numerical value. =2D-=20 Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |