-
Notifications
You must be signed in to change notification settings - Fork 131
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
Matplotlib figures are not shown on the compiled documentation. #788
Comments
Thanks for the report, can you please provide a minimal reproducible example? I don't have any experience with the |
I have created #794 to test this, and it seems to work. What is different in your case? |
Hi @mgeier - I'm facing the same issue. I have attached a zip file with Notes:
The minimal test environment was created using mambaforge with just Here's the full list of the environment (here on a mac)
|
A followup: after a few more tests, there is an option "save widget state automatically" in jupyter-lab: Once this is activated this seems to change something in the saved processed notebook, and the rendering is then correct using both Maybe @Vital-Fernandez can confirm if this also solves the issue for him. |
Yes, the widget state needs to be available for the widget to be shown in the HTML page. Do you want to add this to the documentation, maybe at https://nbsphinx.readthedocs.io/en/0.9.4/code-cells.html#Troubleshooting?
I'm still wondering why |
I think it would be useful to document this - it took me a little while to find this 'widget state' option. Not sure when this was introduced. I could not see the difference between the notebook saved with and without. As to how |
Can you please make a PR? |
Hi I have been using nbsphinx for a couple of years for my library to compile the tutorials from notebooks.
I had to reinstall python and now the figures are not longer showed on the sphinx documentation (they show fine on the jupyter notebooks with
%matplotlib widget
).If I run the command:
python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.__version__)" && jupyter --version && jupyter nbextension list && jupyter labextension list
I get
ipympl version: 0.9.3
Selected Jupyter core packages...
IPython : 8.23.0
ipykernel : 6.29.4
ipywidgets : 8.1.2
jupyter_client : 8.6.1
jupyter_core : 5.7.2
jupyter_server : 2.13.0
jupyterlab : 4.1.6
nbclient : 0.10.0
nbconvert : 7.16.3
nbformat : 5.10.4
notebook : 7.1.2
qtconsole : 5.5.1
traitlets : 5.14.2
Known nbextensions:
config dir: /home/vital/anaconda3/etc/jupyter/nbconfig
notebook section
jupyter-matplotlib/extension enabled
- Validating: OK
nbextensions_configurator/config_menu/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/config_menu/main
jupyterlab-plotly/extension enabled
- Validating: OK
pydeck/extension enabled
- Validating: problems found:
- require? X pydeck/extension
jupyter-js-widgets/extension enabled
- Validating: OK
contrib_nbextensions_help_item/main enabled
- Validating: OK
tree section
nbextensions_configurator/tree_tab/main enabled
- Validating: problems found:
- require? X nbextensions_configurator/tree_tab/main
JupyterLab v4.1.6
/home/vital/PycharmProjects/lime/venv/share/jupyter/labextensions
jupyter-matplotlib v0.11.3 enabled OK
jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
@jupyter-widgets/jupyterlab-manager v5.0.10 enabled OK (python, jupyterlab_widgets)
@jupyter-notebook/lab-extension v7.1.2 enabled OK
I am using ubuntu 22.04.04 with python 3.11 and these are some of the packages I have installed:
docutils 0.20.1
ipympl 0.9.3
ipython 8.23.0
jupyter 1.0.0
jupyter_client 8.6.1
jupyter-console 6.6.3
jupyter-contrib-core 0.4.2
jupyter-contrib-nbextensions 0.7.0
jupyter_core 5.7.2
jupyter-events 0.10.0
jupyter-highlight-selected-word 0.2.0
jupyter-lsp 2.2.5
jupyter-nbextensions-configurator 0.6.3
jupyter_server 2.13.0
jupyter_server_terminals 0.5.3
jupyterlab 4.1.6
jupyterlab_pygments 0.3.0
jupyterlab_server 2.26.0
jupyterlab_widgets 3.0.10
matplotlib 3.7.2
matplotlib-inline 0.1.6
mplcursors 0.5.2
nbclient 0.10.0
nbconvert 7.16.3
nbformat 5.10.4
nbsphinx 0.9.2
notebook 7.1.2
notebook_shim 0.2.4
numpy 1.24.4
pip 24.0
scipy 1.10.1
Sphinx 7.2.6
sphinx-rtd-theme 2.0.0
sphinxcontrib-applehelp 1.0.8
sphinxcontrib-devhelp 1.0.6
sphinxcontrib-htmlhelp 2.0.5
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.7
sphinxcontrib-serializinghtml 1.1.10
Thank you very much for any advice.
The text was updated successfully, but these errors were encountered: