Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Dijkstra probably hates me (Linus Torvalds, in kernel/sched.c)


computers / comp.graphics.apps.gnuplot / Trouble setting xrange when x is a time

SubjectAuthor
* Trouble setting xrange when x is a timestuart.kendrick.sea
`* Re: Trouble setting xrange when x is a timeKarl Ratzsch
 +- Re: Trouble setting xrange when x is a timeHans-Bernhard_Bröker
 `- Re: Trouble setting xrange when x is a timestuart.kendrick.sea

1
Subject: Trouble setting xrange when x is a time
From: stuart.k...@gmail.com
Newsgroups: comp.graphics.apps.gnuplot
Date: Fri, 27 Sep 2019 13:23 UTC
X-Received: by 2002:aed:27c1:: with SMTP id m1mr9963501qtg.197.1569590610506;
Fri, 27 Sep 2019 06:23:30 -0700 (PDT)
X-Received: by 2002:a9d:5e0b:: with SMTP id d11mr3177272oti.82.1569590610354;
Fri, 27 Sep 2019 06:23:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!o24no3811665qtl.0!news-out.google.com!q23ni753qtl.1!nntp.google.com!o24no3811661qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.graphics.apps.gnuplot
Date: Fri, 27 Sep 2019 06:23:30 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.172.128.173;
posting-account=M_ToRAoAAABsShCRDrTEbhx9p9iCZt7G
NNTP-Posting-Host: 75.172.128.173
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a92ba117-f516-4b7e-93e5-8054c032bc3f@googlegroups.com>
Subject: Trouble setting xrange when x is a time
From: stuart.k...@gmail.com
Injection-Date: Fri, 27 Sep 2019 13:23:30 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 53
View all headers
BRIEF
I would like to pull a single day out of my multi-week data file.  So I'm using 'set xrange'.  But I'm stumbling on the format:  gnuplot fails with
C:\Temp\Plot>gnuplot wst-a-rtr.gp
"wst-a-rtr.gp" line 32: Can't plot with an empty x range!

In the config file below, uncommenting either 'set xrange' line results in the above error.  Leaving them both commented out results in a beautiful chart


DETAIL
Data File:
Date            Time            Transmitted     Dropped
2019-09-13 05:21:56 44337071 524986
2019-09-13 05:25:01 44338275 524986
2019-09-13 05:30:02 44340129 524986
2019-09-13 05:35:01 44341967 524986
2019-09-13 05:40:02 44343952 525104
[...]


Config File:
# Define variables
long_title  = 'COPP Drops across Time'
data_file  = 'wst-a-rtr-log.txt'
output_file = 'wst-a-rtr.png'

# File specifics
set datafile sep whitespace
set output output_file

# Chart details
set title long_title font 'sans,30'
set terminal png size 3200,1200
set grid
set xlabel "Date\nTime" font 'sans,18'
#set xrange [ "2019-09-25" : "2019-09-26" ]
#set xrange [ "2019-09-26 00:00" : "2019-09-27 06:00" ]
set ylabel 'Bytes Transmitted' textcolor '#3CB371' font 'sans,18'
set y2label 'Bytes Dropped' textcolor 'red' font 'sans,18'
set ytics border nomirror textcolor '#3CB371'
set y2tics border nomirror textcolor 'red'
set autoscale y
set autoscale y2

# Time formatting
set xdata time
set timefmt "%Y-%m-%d\t%H:%M"
set format x "%Y-%m-%d\n%H:%M"
set mxtics 24
set grid mxtics

# Do the work
plot data_file index 0 using 1:3 axis x1y1 with points pointtype 7 pointsize 1 linecolor rgb '#3CB371' title '', \
'' using 1:4 axis x1y2 with points pointtype 7 pointsize 1 linecolor rgb 'red' title ''



Subject: Re: Trouble setting xrange when x is a time
From: Karl Ratzsch
Newsgroups: comp.graphics.apps.gnuplot
Organization: solani.org
Date: Fri, 27 Sep 2019 21:44 UTC
References: 1
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: mail....@gmx.net (Karl Ratzsch)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Trouble setting xrange when x is a time
Date: Fri, 27 Sep 2019 23:44:44 +0200
Organization: solani.org
Lines: 25
Message-ID: <qmlvsa$at8$1@solani.org>
References: <a92ba117-f516-4b7e-93e5-8054c032bc3f@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: solani.org 1569620682 11176 127.0.0.43 (27 Sep 2019 21:44:42 GMT)
X-Complaints-To: abuse@news.solani.org
NNTP-Posting-Date: Fri, 27 Sep 2019 21:44:42 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101
Thunderbird/60.9.0
Content-Language: de-DE-1901
X-User-ID: eJwNyMkBwCAIBMCWVHaBlMMh/Zdg5jkU3VoGpYLDSTvfxflDJgq3UNF0HK6uTI8l2Jxpm8wSfyO9Ebw=
Cancel-Lock: sha1:0QqUQY5cBEeHBVjxO9Tt50DljTU=
In-Reply-To: <a92ba117-f516-4b7e-93e5-8054c032bc3f@googlegroups.com>
View all headers
Am 27.09.2019 um 15:23 schrieb stuart.kendrick.sea@gmail.com:
I would like to pull a single day out of my multi-week data file.  So I'm using 'set xrange'.  But I'm stumbling on the format:  gnuplot fails with
C:\Temp\Plot>gnuplot wst-a-rtr.gp
"wst-a-rtr.gp" line 32: Can't plot with an empty x range!


set xrange [ "2019-09-25" : "2019-09-26" ]


Type "show xrange" after this, and you see it didnt work. "set
xrange" does not understand formatted time data. Maybe it should
give an error message here. E.g.

  print "2019-09-25" + 1

gives

  2020.0

gnuplots string autopromotion is perhaps a bit too ambitious here. ;)

You need to transform those strings into a unix date, check the
strptime() function.

   Karl


Subject: Re: Trouble setting xrange when x is a time
From: Hans-Bernhard_Bröke
Newsgroups: comp.graphics.apps.gnuplot
Date: Sat, 28 Sep 2019 13:23 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!news.unit0.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From: HBBroe...@t-online.de (Hans-Bernhard_Bröker)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Trouble setting xrange when x is a time
Date: Sat, 28 Sep 2019 15:23:50 +0200
Lines: 18
Message-ID: <gv957eF8du6U1@mid.dfncis.de>
References: <a92ba117-f516-4b7e-93e5-8054c032bc3f@googlegroups.com>
<qmlvsa$at8$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.dfncis.de R+x+lP9rM8IpYU6eh84X4wqd/8DO/JVXzEj+vC/bYEek7hHvsw183CgWfr
Cancel-Lock: sha1:wIWs4LjmAcbBJLgZPirx5zDP1C4=
Openpgp: preference=signencrypt
Autocrypt: addr=HBBroeker@t-online.de; keydata=
mQINBFu0018BEAC34KXenx8N+WV5OOk0YGkpMbnplVar2DFCNTIDEYA6d8S84mD2IB6/R29G
gmE0NNKwt5C0vFvETkF1K8iZlI6TxzmtmTMqQk5lGWnxbv02EsSJu4drIwQssCfYoZ0y3XhL
gUlZa2PrLvrEDI4HHeYCd87xagdsDX2+fBjMMBqnvYgyAU5UOhhG+R6s/8UtHlzyeJTLYXQQ
zYcOFpcX3Q7BsDQukVAhh8RW2ss44TrNmyxbd63dWlG7ZgW525PaA02PsHVSLQz7uIg38S/a
/wtB6VqzudvYwcekMyM/XSn/bxaUCHcGGfW81Nd2YtxH5HuqGddHuuQF2vFuVrF+8dA/rPdS
xUd8ENaP5bueFWg2hWJb7m/uTGHOPNUeITDNLXpIElGZmqchb3j2kkzsebVlsa2BoYWdK4Aa
16gS0TzcgbAaPE5QRyKQlG/KEgUn6NzI2MSMJBilExtqJtw0fdXZzbOE/73XzfGNVCUk+M9l
cXi5QLbYz0jSR2vvR/LXMYrnnl5jZ1Kc3ZNQU/8qaIMVreMybnDWaFYkFDscLPva51w04l6g
VXDAxnV90YKJVzXJeTZhzNfa8MkNwKOmCTGew3ICP9sxIiodB/Qvgb9IkuYSqE+fGvl+IQzU
W5/XhNH3VSyez4gJy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bsRMZVDxpr4gCzKLx5xNFeEYYXkz22iCK7xKy9LzW
fwuRH+vXIsv9PYpcooGL+Sn/T+fU+7L9xDvycflVrNmR05iDiOUYIE2X4dY6ox1X/wwxnMAy
1hcBLXn4PIzvApxfyt1xlXY0WATpyi+GqLagzDya0eXdCSoM8awgpKe+n8/aWQetF4WWhDPI
mZFJJ7pa0jlUvkUH2raS7XOiOJWn9/ZjYoCQMfdY76Wk8L1TBmSHAN0vu9dC5jZfl/pVsspo
fbK0pZZq45gj
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
Thunderbird/60.9.0
In-Reply-To: <qmlvsa$at8$1@solani.org>
Content-Language: de-DE
View all headers
Am 27.09.2019 um 23:44 schrieb Karl Ratzsch:
Am 27.09.2019 um 15:23 schrieb stuart.kendrick.sea@gmail.com:

set xrange [ "2019-09-25" : "2019-09-26" ]

Type "show xrange" after this, and you see it didnt work. "set
xrange" does not understand formatted time data.

That's not quite as true as you make it out to be.  It can understand
time/date strings, but you have to tell it to:

gnuplot> set xdata time
gnuplot> set timefmt '%Y-%m-%d'
gnuplot> set xrange ['2019-02-07':'2020-03-31']
gnuplot> show xrange

        set xdata time
        set xrange [ "2019-02-07" : "2020-03-31" ] noreverse nowriteback


Subject: Re: Trouble setting xrange when x is a time
From: stuart.k...@gmail.com
Newsgroups: comp.graphics.apps.gnuplot
Date: Mon, 30 Sep 2019 11:19 UTC
References: 1 2
X-Received: by 2002:a37:a411:: with SMTP id n17mr18579752qke.216.1569842369841;
Mon, 30 Sep 2019 04:19:29 -0700 (PDT)
X-Received: by 2002:aca:4a50:: with SMTP id x77mr17776907oia.115.1569842369541;
Mon, 30 Sep 2019 04:19:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!o24no3052577qtl.0!news-out.google.com!q23ni167qtl.1!nntp.google.com!o24no3052567qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.graphics.apps.gnuplot
Date: Mon, 30 Sep 2019 04:19:29 -0700 (PDT)
In-Reply-To: <qmlvsa$at8$1@solani.org>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.172.128.173;
posting-account=M_ToRAoAAABsShCRDrTEbhx9p9iCZt7G
NNTP-Posting-Host: 75.172.128.173
References: <a92ba117-f516-4b7e-93e5-8054c032bc3f@googlegroups.com> <qmlvsa$at8$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d704f9cc-b4d6-41e1-b2fb-06d5ec97e34c@googlegroups.com>
Subject: Re: Trouble setting xrange when x is a time
From: stuart.k...@gmail.com
Injection-Date: Mon, 30 Sep 2019 11:19:29 +0000
Content-Type: text/plain; charset="UTF-8"
View all headers
I have fixed this

My error was to place the 'set xrange' ahead of 'set timefmt'

Fails:
set xrange [ '2019-09-26 00:00' : '2019-09-27 06:00' ]
set xdata time
set timefmt "%Y-%m-%d\t%H:%M"

Succeeds:
set xdata time
set timefmt "%Y-%m-%d\t%H:%M"
set xrange [ '2019-09-26 00:00' : '2019-09-27 06:00' ]

--sk


1
rocksolid light 0.7.2
clearneti2ptor