Skip to content

Commit 6d46cb7

Browse files
committed
Fixes #6: Histogram items were not properly drawn
1 parent 123dca4 commit 6d46cb7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* [Issue #3](https://github.com/PlotPyStack/PlotPy/issues/3) - `PlotWidget`: `ZeroDivisionError` on resize while ignoring constraints
88
* [Issue #4](https://github.com/PlotPyStack/PlotPy/issues/4) - Average cross section: `RuntimeWarning: Mean of empty slice.`
9+
* [Issue #6](https://github.com/PlotPyStack/PlotPy/issues/6) - 1D Histogram items are not properly drawn
910

1011
## Version 2.0.1 ##
1112

plotpy/items/histogram.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def update_histogram(self) -> None:
170170
if self.get_hist_source() is None:
171171
return
172172
hist, bin_edges = self.compute_histogram()
173-
hist = np.concatenate((hist, [0]))
173+
# Duplicate the first `hist` value to get a step-like histogram:
174+
hist = np.concatenate(([hist[0]], hist))
174175
if self.logscale:
175176
hist = np.log(hist + 1)
176177

0 commit comments

Comments
 (0)