Skip to content

Fix setting vmin vmax #307

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 4 commits into from
Jul 18, 2024
Merged

Fix setting vmin vmax #307

merged 4 commits into from
Jul 18, 2024

Conversation

melonora
Copy link
Contributor

closes #303

Fixes the problem in #303. Main problem is that clipping for the Normalize object is set to False by default in matplotlib. I have set this value to True and added tests. I don't think we currently have a usecase for setting it to False, but feel free to comment if there is a usecase for us currently.

Copy link
Member

@timtreis timtreis left a comment

Choose a reason for hiding this comment

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

Code lgtm, but can you add the fix to the changelog? Also, what do you think of plotting a 2x1 grid with the non-clipped and clipped image so it's visually easy see the difference?

@melonora
Copy link
Contributor Author

Code lgtm, but can you add the fix to the changelog? Also, what do you think of plotting a 2x1 grid with the non-clipped and clipped image so it's visually easy see the difference?

added to changelog. Regarding 2 x 1 grid, I would if ncols was working xD. I don't want to create a fig object here now.

@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.35%. Comparing base (1b9b577) to head (88c018b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #307      +/-   ##
==========================================
+ Coverage   80.21%   80.35%   +0.13%     
==========================================
  Files          11       11              
  Lines        1739     1746       +7     
==========================================
+ Hits         1395     1403       +8     
+ Misses        344      343       -1     
Files Coverage Δ
src/spatialdata_plot/pl/utils.py 70.21% <100.00%> (+0.34%) ⬆️

@timtreis
Copy link
Member

Why the aversion against the fig object? Used it f.e. in the 0-transparency cmap PR: https://github.com/scverse/spatialdata-plot/pull/302/files#diff-59872f651a8fef967621d774a8b7441219dc474f1d9604424c54fe19a162bbfd

@melonora
Copy link
Contributor Author

I would just solve the issue with ncols as well:) like I would not add more code in a test because of ncols, though behavior in this case is a bit tricky

@melonora
Copy link
Contributor Author

added the baseline to the test for now and will open an issue on ncols as argument

@timtreis timtreis self-requested a review July 16, 2024 14:23
Copy link
Member

@timtreis timtreis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adjusting the test!

@LucaMarconato LucaMarconato merged commit c026fed into scverse:main Jul 18, 2024
5 checks passed
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.

Unable to set vmin and vmax when plotting raster data
4 participants