Reputation: 1
have only one column, else column be some count of items (timestamp's) from pre-set period(ex 5min, 10 20 30 60),
//x - time in case static grid, y - count(x.join(period))
how to draw an intensity curve of the occurrence of time point values
timestamp.csv:
timestamps_col
13.11.2019 15:42
13.11.2019 15:43
13.11.2019 15:45
13.11.2019 15:47
13.11.2019 15:48
13.11.2019 15:51
13.11.2019 15:51
13.11.2019 15:53
13.11.2019 15:54
13.11.2019 15:58
13.11.2019 16:15
13.11.2019 16:19
13.11.2019 16:21
13.11.2019 16:23
13.11.2019 16:23
13.11.2019 16:25
13.11.2019 16:26
13.11.2019 16:29
13.11.2019 16:30
13.11.2019 16:31
13.11.2019 16:33
13.11.2019 16:34
13.11.2019 16:35
13.11.2019 16:37
13.11.2019 16:37
13.11.2019 16:39
14.11.2019 8:38
14.11.2019 8:43
14.11.2019 8:45
14.11.2019 8:58
14.11.2019 8:59
14.11.2019 9:12
14.11.2019 9:14
14.11.2019 9:19
14.11.2019 9:21
14.11.2019 9:22
14.11.2019 9:24
14.11.2019 9:25
14.11.2019 9:35
14.11.2019 9:42
14.11.2019 9:43
14.11.2019 9:56
14.11.2019 10:08
14.11.2019 10:08
14.11.2019 10:12
14.11.2019 10:14
14.11.2019 10:27
14.11.2019 10:30
14.11.2019 10:32
14.11.2019 10:34
14.11.2019 10:36
14.11.2019 10:40
14.11.2019 10:41
14.11.2019 11:03
14.11.2019 11:05
14.11.2019 11:07
so that the graph shows what time periods for N time how many entries appear.
performance drop chart at the end of the day
Upvotes: 0
Views: 83
Reputation: 25714
If I understood your description correctly, you are looking for something like a histogram. In gnuplot check help smooth frequency
.
A starting point for optimization could be the following:
Code:
### histogram with datetime events
reset session
$Data <<EOD
timestamps_col
13.11.2019 15:42
13.11.2019 15:43
13.11.2019 15:45
13.11.2019 15:47
13.11.2019 15:48
13.11.2019 15:51
13.11.2019 15:51
13.11.2019 15:53
13.11.2019 15:54
13.11.2019 15:58
13.11.2019 16:15
13.11.2019 16:19
13.11.2019 16:21
13.11.2019 16:23
13.11.2019 16:23
13.11.2019 16:25
13.11.2019 16:26
13.11.2019 16:29
13.11.2019 16:30
13.11.2019 16:31
13.11.2019 16:33
13.11.2019 16:34
13.11.2019 16:35
13.11.2019 16:37
13.11.2019 16:37
13.11.2019 16:39
14.11.2019 8:38
14.11.2019 8:43
14.11.2019 8:45
14.11.2019 8:58
14.11.2019 8:59
14.11.2019 9:12
14.11.2019 9:14
14.11.2019 9:19
14.11.2019 9:21
14.11.2019 9:22
14.11.2019 9:24
14.11.2019 9:25
14.11.2019 9:35
14.11.2019 9:42
14.11.2019 9:43
14.11.2019 9:56
14.11.2019 10:08
14.11.2019 10:08
14.11.2019 10:12
14.11.2019 10:14
14.11.2019 10:27
14.11.2019 10:30
14.11.2019 10:32
14.11.2019 10:34
14.11.2019 10:36
14.11.2019 10:40
14.11.2019 10:41
14.11.2019 11:03
14.11.2019 11:05
14.11.2019 11:07
EOD
myTimeFmt = "%d.%m.%Y %H:%M"
set style fill solid 1.0
myInterval = 20 # time in minutes
BoxWidthScale = 0.7
# get the date/time of the first event into variable StartTime
set table $Dummy
plot $Data u (StartTime=timecolumn(1,myTimeFmt)) skip 1 every ::0::0 w table
unset table
# define function for time interval start (basically "binning")
IntervalN(n) = int((timecolumn(n,myTimeFmt)-StartTime)/(myInterval*60))*myInterval*60+StartTime
# binning the data into a new table
set format x myTimeFmt timedate
set table $HistoData
plot $Data u (IntervalN(1)) smooth freq
unset table
set format x "%d.%m.\n%Y\n%H:%M" timedate
plot $HistoData u (timecolumn(1,'"'.myTimeFmt.'"')):2:(60*myInterval*BoxWidthScale) \
w boxes title sprintf("Events in %g minute intervals",myInterval)
### end of code
Result:
Upvotes: 1