Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1664

Concatenate two strcol() into an xticlabel?

Newsgroups comp.graphics.apps.gnuplot
Date 2013-02-25 03:14 -0800
Message-ID <186ff373-253f-4c8f-b195-fa4dab8ca4cc@googlegroups.com> (permalink)
Subject Concatenate two strcol() into an xticlabel?
From "Dan'l B" <dan.hinckley@gmail.com>

Show all headers | View raw


I'm working on plotting tidal data and cannot solve a problem with xticlabels.

An example of PDF output of the project to date is here:

http://suiattle.net/transfers/1a-october-2011.pdf

The Sunrise/Sunset data show up on the x-axis in the example because I have used a label to create them to show what I'm after:
mySunriseSet(col4,col2) = sprintf("%s: %s", strcol(4),strcol(2))

The data file looks like this (excerpt from a one month file):

2011-10-03  04:06 12   9.00 feet  High Tide
2011-10-03  06:39 12   Sunrise
2011-10-03  10:06 12   0.58 feet  Low Tide
2011-10-03  16:22 12   9.92 feet  High Tide
2011-10-03  18:17 12   Sunset
2011-10-03  22:56 12  -0.09 feet  Low Tide
2011-10-04  05:13 12   8.63 feet  High Tide
2011-10-04  06:40 12   Sunrise
2011-10-04  11:13 12   0.98 feet  Low Tide
2011-10-04  17:30 12   9.47 feet  High Tide
2011-10-04  18:15 12   Sunset
2011-10-05  00:04 12   0.28 feet  Low Tide
2011-10-05  06:21 12   8.45 feet  High Tide
2011-10-05  06:41 12   Sunrise
2011-10-05  12:23 12   1.18 feet  Low Tide
2011-10-05  18:13 12   Sunset
2011-10-05  18:39 12   9.19 feet  High Tide

What I'd like to do is create an xticlabel which concatenates Sunrise and Sunset with the timestamp for each.

For example:

set timefmt "%Y-%m-%d-%H:%M"
set origin 0,0
unset key
set size noratio
set terminal aqua
set yrange [-2:12]
set y2range [-2:12]
set ytics ("-2" -2,"0" 0,"4" 4,"8" 8,"12" 12)
set y2tics ("-2" -2,"0" 0,"4" 4,"8" 8,"12" 12)
set grid ytics back
set origin 0,.2
set xtics "2011-10-03-00:00", 28800, "2011-10-05-23:30"
set xrange ["2011-10-03-00:00":"2011-10-05-24:00"]
set xtics nomirror scale 0
set xlabel "Testing……"
plot "10-SPTidesOct2011copy.txt" u 1:2:xticlabels(((strcol(4) eq "Sunrise")  || (strcol(4) eq "Sunset") )  ?  (strcol(4).": ".strcol(2)):1/0)

creates an xticlabel "Sunset: time" but because there are two values of strcol(4) & strcol(2) for for each day, the second one steps on the first one.

Can I somehow concatenate the two daily Sunrise/Sunset entries for each 24 hour period and use them for the xticlabel?

Back to comp.graphics.apps.gnuplot | Previous | Next | Find similar | Unroll thread


Thread

Concatenate two strcol() into an xticlabel? "Dan'l B" <dan.hinckley@gmail.com> - 2013-02-25 03:14 -0800

csiph-web