|
From: m s. <mw...@us...> - 2008-11-09 15:02:36
|
> ----- Original Message -----
> From: "Ethan A Merritt" <merritt@u.washington.edu>
> To: gnu...@li...
> Cc: "m sutton" <mw...@us...>, "Hans-Bernhard Bröker" <HBB...@t-...>
> Subject: Re: expanding allowed usage of word() command
> Date: Sat, 8 Nov 2008 09:30:53 -0700
>
>
> On Saturday 08 November 2008, m sutton wrote:
> > Hi all,
> >
> > I was trying to plot a single data file with multiple indexes. I
> > want to plot some indexes with lines and some with points. I
> > tried the following in a 4.3 CVS snapshot:
> >
> > list="points lines points"
> > plot for [j=1:3] 'data' with word(list,j)
> >
> > I thought the word() command would be expanded much like it does
> > for title. However it just results in an expecting error.
> >
> > Should the word() command be expanded in the above situation? If
> > so, would that be difficult to implement?
>
> There is still a fundamental difference between a keyword and
> a string value. Your failed command did get expanded, but the
> expanded form is equivalent to
> plot 'data' with "points", '' with "lines", ...
>
> which isn't a legal command.
I put a few print statements in the code to see what was happening. I added a print statement to f_words to see when the function was being called. And to lookup_table to see what the current token was. I change the commands to the following to force a call to f_words. An the result shows that f_words is not called during the plot command call.
list="foo bar"
print "word 1 = ". word(list,1)
plot for [j=1:2] x with word(list,j)
The results was the following
gnuplot> list="foo bar"
gnuplot> print "word 1 = ". word(list,1)
enter f_words
word 1 = foo
gnuplot> plot for [j=1:2] x with word(list,j)
token = word
^
expecting 'lines', 'points', 'linespoints', 'dots', 'impulses',
'yerrorbars', 'xerrorbars', 'xyerrorbars', 'steps', 'fsteps',
'histeps', 'filledcurves', 'boxes', 'boxerrorbars', 'boxxyerrorbars',
'vectors', 'financebars', 'candlesticks', 'errorlines', 'xerrorlines',
'yerrorlines', 'xyerrorlines', 'pm3d', 'labels', 'histograms',
'image', 'rgbimage'
I guess the real question is should the word() command be allowed to specify the with type?
Mike Sutton
--
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com
|