Skip to content

Commit

Permalink
BUG: get number of hist bins using ceil, not int
Browse files Browse the repository at this point in the history
When tstop is not divisible by 5.0 (global, yuck!), the histogram
that gets created is too small for the x-axis of the plots. Use
ceil() to round up.

Fixes jonescompneurolab#177
  • Loading branch information
Blake Caldwell committed Apr 1, 2021
1 parent 2115ece commit 3da2391
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hnn/qt_spike.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def getdspk(spikes, extinputs, tstop):
haveinputs = True
for ty in dhist.keys():
dhist[ty] = np.histogram(dhist[ty], range=(0, tstop),
bins=int(tstop / binsz))
bins=ceil(tstop / binsz))
if smoothsz > 0:
dhist[ty] = hammfilt(dhist[ty][0], smoothsz)
else:
Expand Down

0 comments on commit 3da2391

Please sign in to comment.