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

Change how upper limit is taken for color_levels #4898

Merged
merged 7 commits into from
May 30, 2024

Conversation

WesleyTheGeolien
Copy link
Contributor

Fixes #4897

I believe that the offset is due to the N parameter in the plotting.utils.color_intervals code and how it is used if there is a clip.

Because of the int(round(...)) we can end up with more values in the camp than the N parameter. So when a slice is taken we should use the Len(cmap) rather than N which introduces an offset if len(camp) != N

@philippjfr
Copy link
Member

Thanks @WesleyTheGeolien! Will have to update the related tests:

FAIL: test_color_intervals_clipped (holoviews.tests.plotting.testplotutils.TestBokehPaletteUtils)
FAIL: test_path_continuously_varying_color_op (holoviews.tests.plotting.bokeh.testpathplot.TestPathPlot)

@philippjfr
Copy link
Member

Also not totally following the correctness of this fix, wouldn't it be more correct not to round and to use floor instead?

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label May 17, 2024
Copy link

codecov bot commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.47%. Comparing base (f39e0a0) to head (0a00be8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4898      +/-   ##
==========================================
- Coverage   88.48%   88.47%   -0.01%     
==========================================
  Files         323      323              
  Lines       67640    67639       -1     
==========================================
- Hits        59848    59846       -2     
- Misses       7792     7793       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro
Copy link
Member

hoxbro commented May 30, 2024

With this change the reported problem now looks like this:

image

Respecting the limit, and also better colorbar axis.

@hoxbro hoxbro merged commit 6a21c19 into holoviz:main May 30, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color levels not respected
3 participants