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

Pass showlegend/template kwargs to plotly #122

Merged
merged 5 commits into from
Jan 7, 2024

Conversation

stes
Copy link
Member

@stes stes commented Jan 3, 2024

Fix #121

@cla-bot cla-bot bot added the CLA signed label Jan 3, 2024
@stes stes requested a review from nastya236 January 3, 2024 22:15
@stes stes self-assigned this Jan 3, 2024
Copy link
Member

@MMathisLab MMathisLab left a comment

Choose a reason for hiding this comment

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

lgtm, although I did not test it...

@nastya236
Copy link
Contributor

nastya236 commented Jan 4, 2024

I think there is still a problem because of how Plotly interprets the color parameter in the marker dictionary, especially when it's linked with discrete labels. I think to how discrete labels the only solution it iteratively go through the unique labels and and the trace to the scetter plot. I made a PR here (branched from @stes branch).

plot_embedding_interactive(embedding, labels, markersize=10, showlegend=True)
labels = array([5, 8, 5, 4, 6, 8, 2, 3, 1, 7, 2, 9, 7, 3, 5, 6, 5, 9, 8, 4, 4, 7,
       2, 0, 1, 9, 5, 7, 5, 4, 9, 5, 1, 5, 3, 6, 4, 6, 3, 6, 3, 6, 0, 0,
       4, 7, 9, 1, 1, 5, 5, 4, 0, 0, 0, 6, 8, 9, 9, 4, 4, 4, 5, 2, 4, 2,
       7, 7, 6, 3, 5, 8, 0, 3, 6, 7, 9, 9, 1, 6, 9, 7, 4, 8, 7, 6, 5, 4,
       4, 0, 2, 9, 6, 6, 9, 2, 3, 6, 7, 6])

Screenshot 2024-01-04 at 12 51 45

I proposed a solutionhere: PR#123

* Fix showlegend for plotly

* Add handling of continuous labels

* Add tests for plotly integration
@stes
Copy link
Member Author

stes commented Jan 4, 2024

spelling error, fixed

@MMathisLab MMathisLab merged commit 45e2229 into main Jan 7, 2024
11 checks passed
@stes stes deleted the stes/fix-plotly-legend-121 branch January 7, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legend labels are not visible while using interactive plots
3 participants