Exporting a notebook to HTML with active '%matplotlib notebook' or '%matplotlib widget' plots

Viewed 150

I am trying to work out if I can export a .ipynb with plots where I still have widget functionality in my plots like zooming, panning, etc.

I tend to use Jupyter Lab, so currently have %matplotlib widget enabled, but it's of no consequence to switch to '%matplotlib notebook' for the sake of the export.

So far I have tried both, and I get either no images at all in my plots, or "broken" widgets with some button labels written out in text (similar to within a notebook when something has gone wrong with a widget).

I have tried from within the menus in Lab, as well as on the command line with commands such as:

jupyter nbconvert --to HTML MC_recon_study.ipynb --no-input --no-prompt

adding --execute and trying just about every iteration possible.

I am getting nowhere with online searches so it is either not possible or I am missing something. The fact I am getting no images regardless of what I try makes me think the latter. Any help would be greatly appreciated!

pip freeze output:

anyio==2.1.0
argon2-cffi==20.1.0
async-generator==1.10
attrs==20.3.0
Babel==2.9.0
backcall==0.2.0
bleach==3.3.0
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
idna==2.10
importlib-metadata==3.4.0
ipykernel==5.4.3                                                                                                                                
ipympl==0.6.3
ipython==7.20.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
jedi==0.18.0
Jinja2==2.11.3
json5==0.9.5
jsonschema==3.2.0
jupyter-client==6.1.11
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.7.1
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyter-server==1.3.0
jupyterlab==3.0.7
jupyterlab-pygments==0.1.2
jupyterlab-server==2.2.1
jupyterlab-sublime==0.4.1
jupyterlab-widgets==1.0.0
kiwisolver==1.3.1
lxml==4.6.2
MarkupSafe==1.1.1
matplotlib==3.3.4
mistune==0.8.4
nbclassic==0.2.6
nbclient==0.5.2
nbconvert==6.0.7
nbformat==5.1.2
nest-asyncio==1.5.1
notebook==6.2.0
numpy==1.20.1
packaging==20.9
pandocfilters==1.4.3
parso==0.8.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.1.0
prometheus-client==0.9.0
prompt-toolkit==3.0.16
ptyprocess==0.7.0
pycparser==2.20
Pygments==2.8.0
pyparsing==2.4.7
pyrsistent==0.17.3
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
pyzmq==22.0.3
requests==2.25.1
Send2Trash==1.5.0
six==1.15.0
sniffio==1.2.0
terminado==0.9.2
testpath==0.4.4
tornado==6.1
traitlets==5.0.5
typing-extensions==3.7.4.3
urllib3==1.26.3
wcwidth==0.2.5
webencodings==0.5.1
webpdf==1.0
widgetsnbextension==3.5.1
zipp==3.4.0

0 Answers
Related