Skip to content

multiple Legends not working in VS code #4560

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

Closed
Camilochiang opened this issue Mar 28, 2024 · 2 comments
Closed

multiple Legends not working in VS code #4560

Camilochiang opened this issue Mar 28, 2024 · 2 comments

Comments

@Camilochiang
Copy link

with plotly 5.20.0 , addding multiple legend 1 within VSCode version 1.87.2 (Windows_NT x 64) do not produce the expected results (a.k.a it only show one legend) when either using the default render (a.ka. fig.show()) or vscode render (a.ka render = ‘vscode’)

this behaivor can be solve with renderer = ‘png’ but the full idea of using plotly is to have interactive figures, so for me this is a bug.

I will not add code as this can be tested with the example code from multiple legend

also, when using an invalidad argument (a.ka. “render”) and not “renderer”, fig.show do not give an error and just ignore the argument. shouldn’t the function check for non valid arguments?

@ndrezn
Copy link
Member

ndrezn commented Mar 28, 2024

This possibly will be solved once a version of VSCode including: microsoft/vscode-notebook-renderers#195 is released. Right now VSCode is running an older version of Plotly.js by default which means it's not using the latest version.

@ndrezn
Copy link
Member

ndrezn commented Mar 28, 2024

You can also see @LiamConnors's workaround here, where you specify a renderer on fig.show(): #4549 (comment)

fig.show(renderer='notebook')

Or by setting this globally in the notebook:

import plotly.io as pio
pio.renderers.default='notebook'

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

No branches or pull requests

2 participants