-
-
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
Fix setting edge colors for Chord graphs using an explicit mapping #3734
Fix setting edge colors for Chord graphs using an explicit mapping #3734
Conversation
and normalization (which is turned on by default). Details: The color map's vmin/vmax was computed based on factors of the whole range whereas the palette only used the factors from the actually used values. When using color normalization this lead to: -- LineCollection normalizing via vmin/vmax computed above, reflecting the whole range. -- ListedColormap is transforming the normalized color values provided by the LineCollection using its own size (N). However that size N was based on the actually used values and hence too small.
Thanks for the fix, it's very much appreciated. |
Presumably for the bokeh backend this was already handled correctly? |
Would a minimal example be useful for regression testing? (not sure how the current set-up of the project is). |
Definitely, you can look at the existing tests in holoviews/tests/plotting/matplotlib/testgraphplot.py |
To keep the conversation going, here's a repro for the bug. import os hv.extension('matplotlib') edges = [{'source': 0, 'target': 2, 'value': 168}, nodes = [{'index': 0, 'group': 'clonal_id', 'name': 'grey'}, Edges reference by the source's node-id -- so include them as well.color_map = {'grey':'grey', '0': 'grey', links_df = pd.DataFrame(edges) output_path = '/tmp/repro.pdf' |
Just going to merge. |
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. |
and normalization (which is turned on by default).
Details:
The color map's vmin/vmax was computed based on factors of the whole range
whereas the palette only used the factors from the actually used values.
When using color normalization this lead to:
-- LineCollection normalizing via vmin/vmax computed above, reflecting the
whole range.
-- ListedColormap is transforming the normalized color values provided by the
LineCollection using its own size (N). However that size N was based on the
actually used values and hence too small.