Search code examples
pythonpython-sphinxrestructuredtext

.. plot directive in restructured text


I was looking at this site. Specifically, the source. It appears to create a plot (complete with source code!) is extremely easy:

.. plot: somefile.py

But, when I try it, sphinx yells at me. "ERROR: Unknown directive type "plot". So the question is how do I teach sphinx about the plot directive?


Solution

  • matplotlib includes a Sphinx directive for a plot directive; see their sample doc for Sphinx and the documenting matplotlib chapter.