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?

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 2017-11-17 10:10 +0100
Organization solani.org
Message-ID <oum92g$8ao$1@solani.org> (permalink)
References <b0451901-7c2a-4dce-be1c-0858c35937c3@googlegroups.com>

Show all headers | 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