[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    RE: display question
From:       "crawford" <crawford () arete ! com>
Date:       2002-07-23 16:06:48
[Download RAW message or body]

On Monday, July 22, 2002 Raoul S. wrote:
>
> trying to display plots based on the
> date title (creation). how to do this?. does the
> data.dat file look ok for it?.
>
> my data.dat file looks something like :
> #02/22/07 01:15:20
> 1 10
> 2 20
> [snipped]
>
>
> #02/22/07 01:20:21
> [so on]

gnuplot ignores everything after an '#' on a line, so there's no way this
scheme will work.

I can think of two alternatives offhand -- neither is quite as convenient as
what you proposed to do.

One is to create a numerical code for the date, write it on every data line
corresponding to that date, and then filter your data based on that code.
That is. if 02/22/07 is given code 5, your data would look like
  1 10 5
  2 20 5
  etc
and you'd plot it with
  plot 'file' using 1:($3==5?$2:0/0)

(You cannot, by the way, use the date itself as the code -- that would
require string variables, and gnuplot does not have such things.)

The other is to use the "index" option (if each date's data is followed by
two blank lines) or the "every" option (if the data are separated by one
blank line).  "index" is probably easier to use.

There are probably other schemes possible, but these are what spring to mind
at the moment.

Dick Crawford, aka crawford@arete.com

 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic