microsoft / live-share

Real-time collaborative development from the comfort of your favorite tools
http://aka.ms/vsls
Creative Commons Attribution 4.0 International
2.27k stars 247 forks source link

Plotly graphs in Python Jupyter Notebook don't show for other users when live sharing #4863

Open lectrician1 opened 1 year ago

lectrician1 commented 1 year ago

Type: Bug

  1. Create a Jupyter Notebook
  2. Import plotly.io and plotly.express import plotly.io as pio import plotly.express as px
  3. Create a plot fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16]) fig.show()
  4. Run the cells
  5. Start a Live Share session and share with friends

What happens:

Friends see interactive plots when they initially load the Live-shared editor, but when they or the host re-run the cells that plot the plots, the plots disappear. They only show for the user who is hosting the live-share session.

Extension version: 1.0.5828 VS Code version: Code 1.75.0 (e2816fe719a4026ffa1ee0189dc89bdfdbafb164, 2023-02-01T15:23:45.584Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 3302)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.84GB (4.80GB free)| |Process Argv|--crash-reporter-id 2e438a36-6729-4a81-8ee8-331793e8b75a| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627cf:30244335 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 vscccc:30610679 pyindex848:30577860 nodejswelcome1cf:30587006 2e4cg342:30602488 pyind779cf:30657577 89544117:30613380 pythonsymbol12cf:30657549 2i9eh265:30646982 ```
ikubaysan commented 1 year ago

I have the same problem with matplotlib plots with Live Share. Guests can run the code, but only the host will see the plots.

koioannis commented 1 year ago

Hi there! I just wanted to suggest a temporary solution for the issue. You could try plotting the figure as an SVG using the fig.show_svg() function. This may not allow for interactive plots, but it could serve as a workaround until a more permanent solution is found. Hope this helps!