Next topic

mmf.sphinx.ext.mmfext

This Page

mmf.sphinx.ext.matplotlibext.plot_directive

plot_directive(name, arguments, options, ...) Handle the plot directive.
write_char(s)
runfile(fullpath) Import a Python module from a path.
out_of_date(original, derived) Returns True if derivative is out-of-date wrt original,
setup(app)
makefig(fullpath, code, outdir) run a pyplot script and save the low and high res PNGs and a PDF in _static

A special directive for including a matplotlib plot.

Given a path to a .py file, it includes the source code inline, then:

  • On HTML, will include a .png with a link to a high-res .png.
  • On LaTeX, will include a .pdf

This directive supports all of the options of the image directive, except for target (since plot will add its own target).

Additionally, if the :include-source: option is provided, the literal source will be included inline, as well as a link to the source.

The set of file formats to generate can be specified with the plot_formats configuration variable.

mmf.sphinx.ext.matplotlibext.plot_directive.plot_directive(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Handle the plot directive.

mmf.sphinx.ext.matplotlibext.plot_directive.write_char(s)[source]
mmf.sphinx.ext.matplotlibext.plot_directive.runfile(fullpath)[source]

Import a Python module from a path.

mmf.sphinx.ext.matplotlibext.plot_directive.out_of_date(original, derived)[source]

Returns True if derivative is out-of-date wrt original, both of which are full file paths.

mmf.sphinx.ext.matplotlibext.plot_directive.setup(app)[source]
mmf.sphinx.ext.matplotlibext.plot_directive.makefig(fullpath, code, outdir)[source]

run a pyplot script and save the low and high res PNGs and a PDF in _static