Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

napari_matplotlib.histogram._get_bins returns different bins depending on type of data passed to it #249

Copy link
Copy link
Closed
@p-j-smith

Description

@p-j-smith
Issue body actions

napari_matplotlib.histogram._get_bins returns fewer bins if the data passed to it are float compared to if they are int.

To reproduce:

import numpy as np
from napari_matplotlib.histogram import _get_bins

data = np.arange(0, 101, dtype=int)
print(_get_bins(data).size)
print(_get_bins(data.astype(float)).size)

which prints:

101
100

To fix, perhaps 100 bins (101 bin edges) should be created with np.linspace for float data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.