jupyter / jupyter-sphinx

Sphinx extension for rendering of Jupyter interactive widgets.
https://jupyter-sphinx.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
186 stars 65 forks source link

Suggestion: --matplotlib=inline as default #138

Closed ihincks closed 4 years ago

ihincks commented 4 years ago

I have noticed that some environments require the ipython magic %matplotlib inline to be present to capture matplotlib output. I have had success using the following configuration to make that unnecessary in all environments I have tested:

jupyter_execute_kwargs = dict(
    timeout=-1, allow_errors=True, extra_arguments=["--matplotlib=inline"]
)

I don't know if there would be any side-effects (I have not taken a dive into jupyter-sphinx), but it could be a decent thing to add to the default jupyter_execute_kwargs?

akhmerov commented 4 years ago

It's a good idea, but it would only work with an ipython kernel. I believe with any other kernel it would raise an error.

ihincks commented 4 years ago

Thanks, that makes sense. TBH, I'm just happy to have this issue raised so that others might find it when searching.