re relative to. If None or empty (the default), file names are relative to the directory where the file containing the directive is. plot_formats File formats to generate (default: ['png', 'hires.png', 'pdf']). List of tuples or strings:: [(suffix, dpi), suffix, ...] that determine the file format and the DPI. For entries whose DPI was omitted, sensible defaults are chosen. When passing from the command line through sphinx_build the list should be passed as suffix:dpi,suffix:dpi, ... plot_html_show_formats Whether to show links to the files in HTML (default: True). plot_rcparams A dictionary containing any non-standard rcParams that should be applied before each plot (default: {}). plot_apply_rcparams By default, rcParams are applied when ``:context:`` option is not used in a plot directive. If set, this configuration option overrides this behavior and applies rcParams before each plot. plot_working_directory By default, the working directory will be changed to the directory of the example, so the code can get at its data files, if any. Also its path will be added to `sys.path` so it can import any helper modules sitting beside it. This configuration option can be used to specify a central directory (also added to `sys.path`) where data files and helper modules for all code are located. plot_template Provide a customized template for preparing restructured text. plot_srcset Allow the srcset image option for responsive image resolutions. List of strings with the multiplicative factors followed by an "x". e.g. ["2.0x", "1.5x"]. "2.0x" will create a png with the default "png" resolution from plot_formats, multiplied by 2. If plot_srcset is specified, the plot directive uses the :doc:`/api/sphinxext_figmpl_directive_api` (instead of the usual figure directive) in the intermediary rst file that is generated. The plot_srcset option is incompatible with *singlehtml* builds, and an error will be raised. Notes on how it works --------------------- The plot directive runs the code it is given, either in the source file or the code under the directive. The figure created (if any) is saved in the sphinx build directory under a subdirectory named ``plot_directive``. It then creates an intermediate rst file that calls a ``.. figure:`` directive (or ``.. figmpl::`` directive if ``plot_srcset`` is being used) and has links to the ``*.png`` files in the ``plot_directive`` directory. These translations can be customized by changing the *plot_template*. See the source of :doc:`/api/sphinxext_plot_directive_api` for the templates defined in *TEMPLATE* and *TEMPLATE_SRCSET*. é