Skip to content

Use integer bins for integer data in HistogramWidget #244

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

Merged
merged 9 commits into from
Jan 15, 2024
Prev Previous commit
Next Next commit
convert bins array to list to make mypy happy
  • Loading branch information
p-j-smith authored and dstansby committed Jan 13, 2024
commit 7b48bc31da0fbd0aa1afff8994ee5c624f2429ed
4 changes: 2 additions & 2 deletions src/napari_matplotlib/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ def draw(self) -> None:
for i, c in enumerate("rgb"):
self.axes.hist(
data[..., i].ravel(),
bins=bins,
bins=bins.tolist(),
label=c,
histtype="step",
color=_COLORS[c],
)
else:
self.axes.hist(data.ravel(), bins=bins, label=layer.name)
self.axes.hist(data.ravel(), bins=bins.tolist(), label=layer.name)

self._contrast_lines = [
self.axes.axvline(lim, color="white")
Expand Down