-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Implement clim_percentile for RGB #6137
Conversation
That is correct. Generally, colorbars only make sense when colormapping and RGBs are already mapped directly to colors. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6137 +/- ##
==========================================
- Coverage 88.69% 88.67% -0.03%
==========================================
Files 316 316
Lines 66017 66024 +7
==========================================
- Hits 58554 58546 -8
- Misses 7463 7478 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
What is frustrating here is that the concept of I suppose this can be documented nicely but I am still not convinced this shouldn't be something handled at the Again, it is really annoying how close this looks to be the right thing even though I do think the semantics are being muddied here! |
else: # True | ||
low, high = np.percentile(img, (self.clim_percentile, 100 - self.clim_percentile)) | ||
img = np.clip(img, low, high) | ||
img = img / high * 255 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
img = img / high * 255 | |
img = (img - low) / (high - low) * 255 |
Another thought as I don't think we are using the full range of the RGB.
Superseded in holoviz/hvplot#1291 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Addresses part of holoviz/hvplot#1251
Now, I'm have trouble figuring out how to apply this logic into HoloViews internally.
I took a stab at it anyway, but it looks a little different than the original imshow with robust=True because imshow uses vmin/vmax of the colorbar, but colorbars aren't a concept in HoloView's RGB (I think), so I'm forced to clip?