Skip to content

Commit 831ae6b

Browse files
committed
Document defaults in plot_directive.
1 parent 450cdc6 commit 831ae6b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@
4747
The ``plot`` directive supports the following options:
4848
4949
format : {'python', 'doctest'}
50-
The format of the input.
50+
The format of the input. If unset, the format is auto-detected.
5151
5252
include-source : bool
53-
Whether to display the source code. The default can be changed
54-
using the `plot_include_source` variable in :file:`conf.py`.
53+
Whether to display the source code. The default can be changed using
54+
the `plot_include_source` variable in :file:`conf.py` (which itself
55+
defaults to False).
5556
5657
encoding : str
5758
If this source file is in a non-UTF8 or non-ASCII encoding, the
@@ -86,25 +87,26 @@
8687
The plot directive has the following configuration options:
8788
8889
plot_include_source
89-
Default value for the include-source option
90+
Default value for the include-source option (default: False).
9091
9192
plot_html_show_source_link
92-
Whether to show a link to the source in HTML.
93+
Whether to show a link to the source in HTML (default: True).
9394
9495
plot_pre_code
95-
Code that should be executed before each plot. If not specified or None
96+
Code that should be executed before each plot. If None (the default),
9697
it will default to a string containing::
9798
9899
import numpy as np
99100
from matplotlib import pyplot as plt
100101
101102
plot_basedir
102-
Base directory, to which ``plot::`` file names are relative
103-
to. (If None or empty, file names are relative to the
104-
directory where the file containing the directive is.)
103+
Base directory, to which ``plot::`` file names are relative to.
104+
If None or empty (the default), file names are relative to the
105+
directory where the file containing the directive is.
105106
106107
plot_formats
107-
File formats to generate. List of tuples or strings::
108+
File formats to generate (default: ['png', 'hires.png', 'pdf']).
109+
List of tuples or strings::
108110
109111
[(suffix, dpi), suffix, ...]
110112
@@ -114,16 +116,16 @@
114116
suffix:dpi,suffix:dpi, ...
115117
116118
plot_html_show_formats
117-
Whether to show links to the files in HTML.
119+
Whether to show links to the files in HTML (default: True).
118120
119121
plot_rcparams
120122
A dictionary containing any non-standard rcParams that should
121-
be applied before each plot.
123+
be applied before each plot (default: {}).
122124
123125
plot_apply_rcparams
124126
By default, rcParams are applied when ``:context:`` option is not used
125-
in a plot directive. This configuration option overrides this behavior
126-
and applies rcParams before each plot.
127+
in a plot directive. If set, this configuration option overrides this
128+
behavior and applies rcParams before each plot.
127129
128130
plot_working_directory
129131
By default, the working directory will be changed to the directory of

0 commit comments

Comments
 (0)