Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
matlab hist plot
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 15, 2020
1 parent c760252 commit 56e488b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion analyze.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 56e488b

Please sign in to comment.