我有一些包含matplotlib
图表的ipynb
文档,这些图表是通过%matplotlib inline
指令内嵌显示的。
当我尝试展示带有内嵌绘制图表的笔记本时,我使用了Sphinx文档。
ipython nbconvert shalom.ipynb --to rst
但是不幸的是,它只给我提供了没有内联图形的RST。仅有代码清单。
你能告诉我如何生成已渲染绘图的Sphinx文档吗?
我知道这是可能的。
我有一些包含matplotlib
图表的ipynb
文档,这些图表是通过%matplotlib inline
指令内嵌显示的。
当我尝试展示带有内嵌绘制图表的笔记本时,我使用了Sphinx文档。
ipython nbconvert shalom.ipynb --to rst
但是不幸的是,它只给我提供了没有内联图形的RST。仅有代码清单。
你能告诉我如何生成已渲染绘图的Sphinx文档吗?
我知道这是可能的。
conf.py
以包括:extensions = [
'matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive',
'matplotlib.sphinxext.ipython_directive',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'ipython_console_highlighting',
'inheritance_diagram',
'numpydoc']
sphinx-build -b html -d _build/doctrees . _build/html your_filename.rst
这样做可以解决问题吗? - James Mills