From 56e488b96702e5e59a94c102cbeedaa6f06f5c41 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 15 Sep 2020 00:26:35 -0400 Subject: [PATCH] matlab hist plot --- analyze.m | 9 ++++++++- analyze.py | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/analyze.m b/analyze.m index cfa8a94..7112753 100644 --- a/analyze.m +++ b/analyze.m @@ -5,7 +5,14 @@ function analyze(file) dat = load_data(file); -disp("loaded data from " + datestr(dat.time(1)) + " to " + datestr(dat.time(end))) +plot_time(dat.time) + +end + + +function plot_time(time) + +histfit(seconds(diff(time)), 100, 'Gamma') end diff --git a/analyze.py b/analyze.py index 0fc433c..f3eeb78 100644 --- a/analyze.py +++ b/analyze.py @@ -20,10 +20,12 @@ def plot_time(time: pandas.Series): """ NOTE: in this simulation, time interval is same distribution for all sensors and rooms + + https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_continuous.fit.html """ ax = plt.figure().gca() - ax.hist(time.diff().dt.total_seconds()) + ax.hist(time.diff().dt.total_seconds(), bins=100) ax.set_xlabel("Time (seconds)") ax.set_title("Time interval") ax.set_ylabel("# of occurences")