Skip to content

Commit

Permalink
Silently ignore if xleft, xright out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
sfegan committed Oct 15, 2024
1 parent 6860225 commit affdf9e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,9 @@ def plot_histogram(h, density = False, normalise = False,

hx = numpy.append(hx, hx[-1]+h.dxval()) * xscale + xoffset

if(hx[0] < xleft):
if(hx[1] < xleft):
raise ValueError("xleft outside of first bin")
if(hx[0] < xleft and hx[1] > xleft):
hx[0] = xleft
if(hx[-1] > xright):
if(hx[-2] > xright):
raise ValueError("xright outside of final bin")
if(hx[-1] > xright and hx[-2] < xright):
hx[-1] = xright

if density:
Expand Down

0 comments on commit affdf9e

Please sign in to comment.