Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG: get number of hist bins using ceil, not int #294

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

blakecaldwell
Copy link
Member

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 #177

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
@blakecaldwell blakecaldwell changed the title BUG: get number of hist bins using ceil, not int MRG: get number of hist bins using ceil, not int Apr 1, 2021
@blakecaldwell blakecaldwell added the bug Something isn't working label Apr 1, 2021
@@ -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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just used the default bins of matplotlib?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Please contribute a PR for that that supercedes this.

@blakecaldwell
Copy link
Member Author

This is a quick fix to #177. I think this whole file should be rewritten.

@jasmainak jasmainak merged commit e0bb18d into jonescompneurolab:master Apr 1, 2021
@jasmainak
Copy link
Collaborator

Let's merge for now, we'll find proper fixes later

@jasmainak
Copy link
Collaborator

Thanks @blakecaldwell !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spiking activity fails to display
2 participants