jupyter-widgets / ipywidgets

Interactive Widgets for the Jupyter Notebook
https://ipywidgets.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.17k stars 949 forks source link

Interactive Plots Not Included in Jupyter Notebook Print or Download #3073

Open boilednut opened 3 years ago

boilednut commented 3 years ago

I apologize if this isn't the proper forum for this issue. I have a notebook that includes several interactive matplotlib plots --generated using the ipywidgets interact decorator. Whenever I attempt to print or download the notebook (as PDF or HTML), none of the interactive plots are included. However, for PDF downloads, text like the following is included instead:

interactive(children=(FloatSlider(value=...

Using the 'Save Notebook Widget State' setting, I've been able to get the interactive plots to appear when the notebook is opened into a new kernel; but, even with this setting enabled, the plots still don't appear when the notebook is printed or downloaded.

cladosphaero commented 2 years ago

Hi @boilednut, I am having the same issue.

MarkusKonk commented 1 year ago

@boilednut @cladosphaero Strange that such a basic function doesn't work or doesn't exist.... Maybe this workaround helps you: https://stackoverflow.com/questions/35305607/jupyter-notebook-matplotlib-figures-missing-in-exported-pdf

maartenbreddels commented 1 year ago

https://github.com/jupyter-widgets/ipywidgets/pull/3107 might be an interesting discussion.

But, I think that HTML rendering should work, and combined with the webpdf renderer of nbconvert, you should be able to get a pdf with the rendered widgets.

JWock82 commented 1 week ago

I'm having this problem too in late 2024. This issue has been open for some time. Any updates?