Skip to content

Commit

Permalink
Updated call to Numpy histgram()
Browse files Browse the repository at this point in the history
  • Loading branch information
scottransom committed Nov 17, 2019
1 parent 961bc1a commit cd8a847
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/presto/psr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ def hist(data, bins, range=None, laby="Number", **kwargs):
data values are used to define the interval.
Note: This command also accepts all the keyword arge of plotbinned().
"""
(ys, lox, dx, out) = Num.histogram(data, bins, range)
xs = Num.arange(bins, dtype='d') * dx + lox + 0.5 * dx
ys, bin_edges = Num.histogram(data, bins, range)
dx = bin_edges[1] - bin_edges[0]
xs = bin_edges[:-1] + 0.5 * dx
maxy = int(1.1 * max(ys))
if maxy < max(ys):
maxy = max(ys) + 1.0
Expand Down

0 comments on commit cd8a847

Please sign in to comment.