|
From: Mojca M. <moj...@gm...> - 2009-03-09 16:24:04
|
On Mon, Mar 9, 2009 at 16:00, Juergen Wieferink wrote:
>> I'm trying to use table header for title, but this fails to work:
>> plot for [n=2:26] 'mydata.dat' using 1:n title n with lines
>> raising an error
>> expecting "title" for plot
>>
>> "title 2" works OK but I can only get a single label with that, "title
>> sprintf("%d", n)" would also help in some cases, but not this time
>> since the label I need is not a linear function of column.
>>
>> lines 110-112 (may vary from the latest version) in datafile.c say:
>>
>> } else if (!END_OF_COMMAND && isanumber(c_token)) {
>> column_for_key_title = int_expression();
>> } else /* Let the general case parser handle it */
>>
>> Can someone please give me a tiny hint if there's a way to use labels
>> from column headers with loops?
>
>From the code a few lines above the snippet you've shown:
I don't (or at least didn't try hard enough to) understand much of the
code. Naively I tried changing the code into
} else if (!END_OF_COMMAND) {
if(isanumber(c_token)) {
column_for_key_title = int_expression();
} else {
column_for_key_title = (int)(real(const_express(&a)));
}
as a temporary patch to be able to experiment with the data I have,
but this is definitely the wrong way to go :) :) :)
> plot for [n=2:26] 'mydata.dat' using 1:n title column (n) with lines
Many thanks.
May I request adding a simple example like this (using for loop and
"title column()") to
http://gnuplot.sourceforge.net/demo/datastrings.html
?
Also, it would be very helpful to havea tiny bit of information or a
simple sample available under
"help for"
I have read again "help plot/title" and then "datastrings", but didn't
find the any mention of "column". May I request adding some info on
that?
Thanks a lot,
Mojca
|