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


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

Re: Newbie Help - Can gnuplot do what I need without modifying the input file?

Path csiph.com!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Newbie Help - Can gnuplot do what I need without modifying the input file?
Date Fri, 17 Nov 2017 10:10:45 +0100
Organization solani.org
Lines 37
Message-ID <oum92g$8ao$1@solani.org> (permalink)
References <b0451901-7c2a-4dce-be1c-0858c35937c3@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace solani.org 1510909840 8536 eJwNyMkBwDAIA7CVuIzLODSE/Udo9RQ8NQ8jkYHFzpvWdv7TEGFhCI5v+0XzCsXCmVpbfKTsAxA6EBY= (17 Nov 2017 09:10:40 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 17 Nov 2017 09:10:40 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
Content-Language en-GB
Cancel-Lock sha1:r1wjd8vNRe2tU1BN1nxzpdzX/VM=
X-User-ID eJwFwQkBACAIBLBK/BxxBKV/BDfX4Ji08DBfX4B3YkWYsquu3kmALusTHBcZHFK2Ku5X2h8NkxB3
In-Reply-To <b0451901-7c2a-4dce-be1c-0858c35937c3@googlegroups.com>
X-NNTP-Posting-Host eJwFwYEBgDAIA7CXwLUFzhFw/59gwiPXBESBl3e801Kk/EzMk97vmikQ5VgvsRKIri+xMT/94Q/3
Xref csiph.com comp.graphics.apps.gnuplot:3822

Show key headers only | View raw


Am 16.11.2017 um 22:05 schrieb eamonn.carlin@gmail.com:
> I'm using python on a Pi to log movement detected by a Infrared sensor. I'd like to represent the data on a line/bar graph with time on the x axis and the y axis being binary to represent movemnet (1) or no movement (0).

> Start Date,Start Time, End Date, End Time, Duration
> 2017-11-02,19:45:20,2017-11-02,19:45:59,0:00:38
> 2017-11-02,22:26:53,2017-11-02,22:27:50,0:00:56
> 2017-11-03,01:09:49,2017-11-03,01:10:31,0:00:42

You can make a vector plot,

  plot dataf us 2:(1):5:(0) with vectors

, however that only gives you lines over "duration" (at y=1), not in
the standstill time inbetween (0).

Easiest would be if you recorded the standstill times also, e.g.

1am 30min 1
1:30am 1h 0
2:30am 40min 1
3:10am 10 min 0
etc.

but I think we can do without:

  replot l=("7am"), dataf us (ll=l,l=$4,ll):(0):($2-ll):(0) with vectors

(replace "7am" with 7*3600, that's not plotted, it only initialises
l before plotting to the given value)

This stores the value of column 4 in "l" after shifting the last
value of "l" into "ll", and then plots a vertical line from "ll"
with lenght of the time between the last datapoint and the present.

Check "help ternary operator" about the first part of the "using"
specifier. It could be a bit tricky if the first movement starts at
exactly 7am

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


Thread

Newbie Help - Can gnuplot do what I need without modifying the input file? eamonn.carlin@gmail.com - 2017-11-16 13:05 -0800
  Re: Newbie Help - Can gnuplot do what I need without modifying the input file? Karl Ratzsch <mail.kfr@gmx.net> - 2017-11-17 10:10 +0100
    Re: Newbie Help - Can gnuplot do what I need without modifying the input file? eamonn.carlin@gmail.com - 2017-11-20 14:46 -0800

csiph-web