Skip to content

Conversation

dstansby
Copy link
Member

Fixes #187

@@ -33,14 +33,21 @@ def draw(self) -> None:
Clear the axes and histogram the currently selected layer/slice.
"""
layer = self.layers[0]
bins = np.linspace(np.min(layer.data), np.max(layer.data), 100)
print(layer.data.shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Debug output? To be removed?

# Important to calculate bins after slicing 3D data, to avoid reading
# whole cube into memory.
bins = np.linspace(np.min(data), np.max(data), 100)
print(bins)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
print(bins)

Ditto.

@dstansby dstansby merged commit 8dbfdba into matplotlib:main Jul 26, 2023
@dstansby dstansby deleted the histogram-data branch July 26, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't read all data into memory when launching HistogramWidget
2 participants