Skip to content
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

Missing tests for norm=Normalize(...) #372

Open
Sonja-Stockhaus opened this issue Oct 16, 2024 · 2 comments
Open

Missing tests for norm=Normalize(...) #372

Sonja-Stockhaus opened this issue Oct 16, 2024 · 2 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@Sonja-Stockhaus
Copy link
Collaborator

Sonja-Stockhaus commented Oct 16, 2024

Currently, we don't have enough tests including the norm=Normalize(...) argument. It should work for matplotlib and also datshader (after #309), but I think we need some more tests and maybe also a bit more documentation.

Also, I noted that both seem to give the same result, not sure if that's a bug

from spatialdata.datasets import blobs
from matplotlib.colors import Normalize
blob=blobs()

blob.pl.render_points(color="instance_id", size=40, norm=Normalize(4, 7, clip=True)).pl.show()
blob.pl.render_points(color="instance_id", size=40, norm=Normalize(4, 7, clip=False)).pl.show()

Image
Image

@Sonja-Stockhaus Sonja-Stockhaus added bug Something isn't working documentation Improvements or additions to documentation labels Oct 16, 2024
@LucaMarconato
Copy link
Member

LucaMarconato commented Jan 5, 2025

Thanks for reporting. The instance_id column has values in [0, 1, ..., 9]. With clip=True one would expect the values [0, 1, 2, 3, 4] to have the same color, and the values [7, 8, 9] to have the same color. So it seems like that there is a bug.

Did you notice this only for matplotlib or also for datashader?

@Sonja-Stockhaus
Copy link
Collaborator Author

When using datashader, both plots look identical as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants