diff --git a/doc/api/docstring_api.rst b/doc/api/docstring_api.rst
new file mode 100644
index 000000000000..853ff93494cf
--- /dev/null
+++ b/doc/api/docstring_api.rst
@@ -0,0 +1,8 @@
+************************
+``matplotlib.docstring``
+************************
+
+.. automodule:: matplotlib.docstring
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/doc/api/index.rst b/doc/api/index.rst
index 35677bf0afdc..f936188051e6 100644
--- a/doc/api/index.rst
+++ b/doc/api/index.rst
@@ -87,6 +87,7 @@ Matplotlib consists of the following submodules:
container_api.rst
contour_api.rst
dates_api.rst
+ docstring_api.rst
dviread.rst
figure_api.rst
font_manager_api.rst
diff --git a/doc/api/prev_api_changes/api_changes_3.1.0.rst b/doc/api/prev_api_changes/api_changes_3.1.0.rst
index 2c0f629729db..dcdde2ddeef6 100644
--- a/doc/api/prev_api_changes/api_changes_3.1.0.rst
+++ b/doc/api/prev_api_changes/api_changes_3.1.0.rst
@@ -767,11 +767,12 @@ The following signature related behaviours are deprecated:
keyword.
- The *interp_at_native* parameter to `.BboxImage`, which has had no effect
since Matplotlib 2.0, is deprecated.
-- All arguments to the `.cbook.deprecated` decorator and `.cbook.warn_deprecated`
- function, except the first one (the version where the deprecation occurred),
- are now keyword-only. The goal is to avoid accidentally setting the "message"
- argument when the "name" (or "alternative") argument was intended, as this has
- repeatedly occurred in the past.
+- All arguments to the `~.cbook.deprecation.deprecated` decorator and
+ `~.cbook.deprecation.warn_deprecated` function, except the first one (the
+ version where the deprecation occurred), are now keyword-only. The goal is
+ to avoid accidentally setting the "message" argument when the "name" (or
+ "alternative") argument was intended, as this has repeatedly occurred in the
+ past.
- The arguments of `matplotlib.testing.compare.calculate_rms` have been renamed
from ``expectedImage, actualImage``, to ``expected_image, actual_image``.
- Passing positional arguments to `.Axis.set_ticklabels` beyond *ticklabels*
@@ -1073,11 +1074,12 @@ This only served as a helper to the private `.Axis._update_ticks`
Undeprecations
--------------
-The following API elements have bee un-deprecated:
+The following API elements have been un-deprecated:
-- The *obj_type* kwarg to the `.cbook.deprecated` decorator.
-- *xmin*, *xmax* kwargs to `.Axes.set_xlim` and *ymin*, *ymax* kwargs
- to `.Axes.set_ylim`
+- The *obj_type* keyword argument to the `~.cbook.deprecation.deprecated`
+ decorator.
+- *xmin*, *xmax* keyword arguments to `.Axes.set_xlim` and *ymin*, *ymax*
+ keyword arguments to `.Axes.set_ylim`
New features
diff --git a/doc/api/testing_api.rst b/doc/api/testing_api.rst
index 7731d4510b27..808d2b870109 100644
--- a/doc/api/testing_api.rst
+++ b/doc/api/testing_api.rst
@@ -3,6 +3,11 @@
**********************
+:func:`matplotlib.test`
+=======================
+
+.. autofunction:: matplotlib.test
+
:mod:`matplotlib.testing`
=========================
diff --git a/doc/devel/MEP/MEP10.rst b/doc/devel/MEP/MEP10.rst
index 40ea4e2758cc..9e9650587f55 100644
--- a/doc/devel/MEP/MEP10.rst
+++ b/doc/devel/MEP/MEP10.rst
@@ -159,7 +159,7 @@ Implementation
should be divided on a per-module basis so no single developer is
over-burdened by it.
-3. Reorganize the API docs using autosummary and `sphinx-autogen`.
+3. Reorganize the API docs using autosummary and ``sphinx-autogen``.
This should hopefully have minimal impact on the narrative
documentation.
@@ -167,7 +167,7 @@ Implementation
extracts the module docstring from the example and includes it in a
non-literal part of the example page.
-5. Use `sphinx-quickstart` to generate a new-style Sphinx Makefile.
+5. Use ``sphinx-quickstart`` to generate a new-style Sphinx Makefile.
The following features in the current :file:`make.py` will have to be
addressed in some other way:
diff --git a/doc/devel/MEP/MEP12.rst b/doc/devel/MEP/MEP12.rst
index 3ab2e74425ee..87489393b2f5 100644
--- a/doc/devel/MEP/MEP12.rst
+++ b/doc/devel/MEP/MEP12.rst
@@ -11,7 +11,8 @@ Status
**Progress**
Initial changes added in 1.3. Conversion of the gallery is on-going.
-29 September 2015 - The last ``pylab_examples`` where `pylab` is imported has been converted over to use :mod:`matplotlib.pyplot` and `numpy`.
+29 September 2015 - The last ``pylab_examples`` where ``pylab`` is imported has
+been converted over to use :mod:`matplotlib.pyplot` and `numpy`.
Branches and Pull requests
==========================
diff --git a/doc/devel/MEP/MEP14.rst b/doc/devel/MEP/MEP14.rst
index 6653b1faecd0..e3e7127abda9 100644
--- a/doc/devel/MEP/MEP14.rst
+++ b/doc/devel/MEP/MEP14.rst
@@ -265,16 +265,16 @@ Implementation
==============
A concept of a "text engine" will be introduced. Each text engine
-will implement a number of abstract classes. The `TextFont` interface
+will implement a number of abstract classes. The ``TextFont`` interface
will represent text for a given set of font properties. It isn't
necessarily limited to a single font file -- if the layout engine
supports rich text, it may handle a number of font files in a family.
-Given a `TextFont` instance, the user can get a `TextLayout` instance,
+Given a ``TextFont`` instance, the user can get a ``TextLayout`` instance,
which represents the layout for a given string of text in a given
-font. From a `TextLayout`, an iterator over `TextSpans` is returned
+font. From a ``TextLayout``, an iterator over ``TextSpan``\ s is returned
so the engine can output raw editable text using as few spans as
possible. If the engine would rather get individual characters, they
-can be obtained from the `TextSpan` instance::
+can be obtained from the ``TextSpan`` instance::
class TextFont(TextFontBase):
@@ -376,10 +376,10 @@ copy of the path for each character will be stored in the file.
Special casing: The "usetex" functionality currently is able to get
Postscript directly from TeX to insert directly in a Postscript file,
but for other backends, parses a DVI file and generates something more
-abstract. For a case like this, `TextLayout` would implement
-`get_spans` for most backends, but add `get_ps` for the Postscript
+abstract. For a case like this, ``TextLayout`` would implement
+``get_spans`` for most backends, but add ``get_ps`` for the Postscript
backend, which would look for the presence of this method and use it
-if available, or fall back to `get_spans`. This kind of special
+if available, or fall back to ``get_spans``. This kind of special
casing may also be necessary, for example, when the graphics backend
and text engine belong to the same ecosystem, e.g. Cairo and Pango, or
MacOSX and CoreText.
diff --git a/doc/devel/MEP/MEP15.rst b/doc/devel/MEP/MEP15.rst
index 550bb5922d7b..dc1802e33b8c 100644
--- a/doc/devel/MEP/MEP15.rst
+++ b/doc/devel/MEP/MEP15.rst
@@ -18,9 +18,9 @@ None so far.
Abstract
========
-When one axis of a 2-dimensional plot if overridden via `~.Axes.set_xlim` or `~.Axes.set_ylim`,
-automatic scaling of the remaining axis should be based on the data that falls
-within the specified limits of the first axis.
+When one Axis of a 2-dimensional plot is overridden via `~.Axes.set_xlim` or
+`~.Axes.set_ylim`, automatic scaling of the remaining Axis should be based on
+the data that falls within the specified limits of the first Axis.
Detailed description
====================
diff --git a/doc/devel/MEP/MEP22.rst b/doc/devel/MEP/MEP22.rst
index 38753c01ca41..d7e93bb5744d 100644
--- a/doc/devel/MEP/MEP22.rst
+++ b/doc/devel/MEP/MEP22.rst
@@ -39,7 +39,7 @@ reconfiguration.
This approach will make easier to create and share tools among
users. In the far future, we can even foresee a kind of Marketplace
-for `Tools` where the most popular can be added into the main
+for ``Tool``\ s where the most popular can be added into the main
distribution.
Detailed description
@@ -53,12 +53,12 @@ example see https://github.com/matplotlib/matplotlib/issues/2694 also
the shortcuts are hardcoded and again not easily modifiable
https://github.com/matplotlib/matplotlib/issues/2699
-The proposed solution is to take the actions out of the `Toolbar` and
-the shortcuts out of the `Canvas`. This actions and shortcuts will be
-in the form of `Tools`.
+The proposed solution is to take the actions out of the ``Toolbar`` and the
+shortcuts out of the ``Canvas``. The actions and shortcuts will be in the form
+of ``Tool``\ s.
-A new class `Navigation` will be the bridge between the events from
-the `Canvas` and `Toolbar` and redirect them to the appropriate `Tool`.
+A new class ``Navigation`` will be the bridge between the events from the
+``Canvas`` and ``Toolbar`` and redirect them to the appropriate ``Tool``.
At the end the user interaction will be divided into three classes:
@@ -75,7 +75,8 @@ Implementation
ToolBase(object)
----------------
-Tools can have a graphical representation as the `SubplotTool` or not even be present in the Toolbar as `Quit`
+Tools can have a graphical representation as the ``SubplotTool`` or not even be
+present in the Toolbar as ``Quit``.
The `.ToolBase` has the following class attributes for configuration at definition time
@@ -93,7 +94,8 @@ The following instance attributes are set at instantiation:
* keypress associated with the Tool Keymap
* Call to navigation.trigger_tool(name)
* set_figure(self, figure): Set the figure and navigation attributes
- * ``destroy(self, *args)``: Destroy the `Tool` graphical interface (if exists)
+ * ``destroy(self, *args)``: Destroy the ``Tool`` graphical interface (if
+ exists)
**Available Tools**
* ToolQuit
@@ -137,7 +139,7 @@ NavigationBase
Defines the following attributes
* canvas:
- * keypresslock: Lock to know if the `canvas` key_press_event` is
+ * keypresslock: Lock to know if the ``canvas`` ``key_press_event`` is
available and process it
* messagelock: Lock to know if the message is available to write
@@ -152,9 +154,9 @@ Public methods for **User use**:
associated with the tool
* set_tool_keymap(self, name, ``*keys``): Set the keys for the given tool
* remove_tool(self, name): Removes tool from the navigation control.
- * add_tools(self, tools): Add multiple tools to `Navigation`
+ * add_tools(self, tools): Add multiple tools to ``Navigation``
* add_tool(self, name, tool, group=None, position=None): Add a tool
- to the Navigation
+ to the ``Navigation``
* tool_trigger_event(self, name, sender=None, canvasevent=None,
data=None): Trigger a tool and fire the event
@@ -168,20 +170,20 @@ ToolbarBase
-----------
Methods for **Backend implementation**
- * add_toolitem(self, name, group, position, image, description,
- toggle): Add a toolitem to the toolbar. This method is a callback
- from `tool_added_event` (emitted by navigation)
- * set_message(self, s): Display a message on toolbar or in status bar
- * toggle_toolitem(self, name): Toggle the toolitem without firing
- event.
- * remove_toolitem(self, name): Remove a toolitem from the `Toolbar`
+
+* ``add_toolitem(self, name, group, position, image, description, toggle)``:
+ Add a toolitem to the toolbar. This method is a callback from
+ ``tool_added_event`` (emitted by navigation)
+* ``set_message(self, s)``: Display a message on toolbar or in status bar
+* ``toggle_toolitem(self, name)``: Toggle the toolitem without firing event.
+* ``remove_toolitem(self, name)``: Remove a toolitem from the ``Toolbar``
Backward compatibility
======================
For backward compatibility added 'navigation' to the list of values
-supported by :rc:`toolbar`, that is used for Navigation classes
+supported by :rc:`toolbar`, that is used for ``Navigation`` classes
instantiation instead of the NavigationToolbar classes
With this parameter, it makes it transparent to anyone using the
diff --git a/doc/devel/MEP/MEP23.rst b/doc/devel/MEP/MEP23.rst
index d43d82a3a37f..11fd965c4816 100644
--- a/doc/devel/MEP/MEP23.rst
+++ b/doc/devel/MEP/MEP23.rst
@@ -23,7 +23,7 @@ Abstract
========
Add the possibility to have multiple figures grouped under the same
-`FigureManager`
+`~.backend_template.FigureManager`
Detailed description
====================
@@ -38,7 +38,7 @@ desirable to be able to group these under the same window
[see](https://github.com/matplotlib/matplotlib/issues/2194).
The proposed solution modifies `.FigureManagerBase` to contain and manage more
-than one `canvas`. The settings parameter :rc:`backend.multifigure` control
+than one ``Canvas``. The settings parameter :rc:`backend.multifigure` control
when the **MultiFigure** behaviour is desired.
**Note**
@@ -46,7 +46,7 @@ when the **MultiFigure** behaviour is desired.
It is important to note, that the proposed solution, assumes that the
[MEP22](https://github.com/matplotlib/matplotlib/wiki/Mep22) is
already in place. This is simply because the actual implementation of
-the `Toolbar` makes it pretty hard to switch between canvases.
+the ``Toolbar`` makes it pretty hard to switch between canvases.
Implementation
==============
@@ -54,44 +54,49 @@ Implementation
The first implementation will be done in GTK3 using a Notebook as
canvas container.
-`.FigureManagerBase`
---------------------
+``FigureManagerBase``
+---------------------
will add the following new methods
-* `add_canvas`: To add a canvas to an existing `FigureManager` object
-* `remove_canvas`: To remove a canvas from a `FigureManager` object,
- if it is the last one, it will be destroyed
-* `move_canvas`: To move a canvas from one `FigureManager` to another.
-* `set_canvas_title`: To change the title associated with a specific
+* ``add_canvas``: To add a canvas to an existing
+ `~.backend_template.FigureManager` object
+* ``remove_canvas``: To remove a canvas from a
+ `~.backend_template.FigureManager` object, if it is the last one, it will be
+ destroyed
+* ``move_canvas``: To move a canvas from one `~.backend_template.FigureManager`
+ to another.
+* ``set_canvas_title``: To change the title associated with a specific
canvas container
-* `get_canvas_title`: To get the title associated with a specific
+* ``get_canvas_title``: To get the title associated with a specific
canvas container
-* `get_active_canvas`: To get the canvas that is in the foreground and
- is subject to the gui events. There is no `set_active_canvas`
- because the active canvas, is defined when `show` is called on a
- `Canvas` object.
+* ``get_active_canvas``: To get the canvas that is in the foreground and
+ is subject to the gui events. There is no ``set_active_canvas``
+ because the active canvas, is defined when ``show`` is called on a
+ ``Canvas`` object.
-`new_figure_manager`
---------------------
+``new_figure_manager``
+----------------------
-To control which `FigureManager` will contain the new figures, an
-extra optional parameter *figuremanager* will be added, this parameter
-value will be passed to `new_figure_manager_given_figure`
+To control which `~.backend_template.FigureManager` will contain the new
+figures, an extra optional parameter *figuremanager* will be added, this
+parameter value will be passed to ``new_figure_manager_given_figure``.
-`new_figure_manager_given_figure`
----------------------------------
+``new_figure_manager_given_figure``
+-----------------------------------
-* If *figuremanager* parameter is given, this `FigureManager` object
- will be used instead of creating a new one.
+* If *figuremanager* parameter is given, this
+ `~.backend_template.FigureManager` object will be used instead of creating a
+ new one.
* If ``rcParams['backend.multifigure']`` is True: The last
- `FigureManager` object will be used instead of creating a new one.
+ `~.backend_template.FigureManager` object will be used instead of creating a
+ new one.
-`NavigationBase`
-----------------
+``NavigationBase``
+------------------
-Modifies the `NavigationBase` to keep a list of canvases, directing
-the actions to the active one
+Modifies the ``NavigationBase`` to keep a list of canvases, directing the
+actions to the active one.
Backward compatibility
======================
diff --git a/doc/devel/MEP/MEP26.rst b/doc/devel/MEP/MEP26.rst
index dc09d9b9ff22..929393a683d2 100644
--- a/doc/devel/MEP/MEP26.rst
+++ b/doc/devel/MEP/MEP26.rst
@@ -65,14 +65,13 @@ The new methodology would require development of a number of steps:
Implementation
==============
-It will be easiest to allow a '3rd party' to modify/set the style of
-an artist if the 'style' is created as a separate class and store
-against the artist as a property. The `.GraphicsContext` class already
-provides a the basis of a `Style` class and an artist's `~.Artist.draw` method can
-be refactored to use the `Style` class rather than setting up it's own
-`.GraphicsContext` and transferring it's style-related properties to
-it. A minimal example of how this could be implemented is shown here:
-https://github.com/JamesRamm/mpl_experiment
+It will be easiest to allow a '3rd party' to modify/set the style of an artist
+if the 'style' is created as a separate class and store against the artist as a
+property. The `.GraphicsContextBase` class already provides a the basis of a
+``Style`` class and an artist's `~.Artist.draw` method can be refactored to use
+the ``Style`` class rather than setting up its own `.GraphicsContextBase` and
+transferring its style-related properties to it. A minimal example of how this
+could be implemented is shown here: https://github.com/JamesRamm/mpl_experiment
IMO, this will also make the API and code base much neater as
individual get/set methods for artist style properties are now
diff --git a/doc/devel/MEP/MEP29.rst b/doc/devel/MEP/MEP29.rst
index 13e649284bb2..ae7eae9fe43e 100644
--- a/doc/devel/MEP/MEP29.rst
+++ b/doc/devel/MEP/MEP29.rst
@@ -29,7 +29,7 @@ Using different size/color/family in a text annotation is difficult because the
`~.Axes.text` method accepts argument for size/color/family/weight/etc. that are used
for the whole text. But, if one wants, for example, to have different colors,
one has to look at the gallery where one such example is provided:
-http://matplotlib.org/examples/text_labels_and_annotations/rainbow_text.html
+:doc:`/gallery/text_labels_and_annotations/rainbow_text`
This example takes a list of strings as well as a list of colors which makes it
cumbersome to use. An alternative would be to use a restricted set of pango_-like markup and to interpret this markup.
@@ -59,8 +59,8 @@ Improvements
Problems
--------
-* One serious problem is how to deal with text having both latex and
- html-like tags. For example, consider the following::
+* One serious problem is how to deal with text having both LaTeX and
+ HTML-like tags. For example, consider the following::
$Bold$
diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst
index 38439a49dd17..e004dbafba17 100644
--- a/doc/devel/contributing.rst
+++ b/doc/devel/contributing.rst
@@ -409,11 +409,10 @@ C/C++ extensions
Keyword argument processing
---------------------------
-Matplotlib makes extensive use of ``**kwargs`` for pass-through
-customizations from one function to another. A typical example is in
-:func:`matplotlib.pyplot.text`. The definition of the pylab text
-function is a simple pass-through to
-:meth:`matplotlib.axes.Axes.text`::
+Matplotlib makes extensive use of ``**kwargs`` for pass-through customizations
+from one function to another. A typical example is in `matplotlib.pyplot.text`.
+The definition of the pylab text function is a simple pass-through to
+`matplotlib.axes.Axes.text`::
# in pylab.py
def text(*args, **kwargs):
@@ -421,17 +420,15 @@ function is a simple pass-through to
draw_if_interactive()
return ret
-:meth:`~matplotlib.axes.Axes.text` in simplified form looks like this,
-i.e., it just passes all ``args`` and ``kwargs`` on to
-:meth:`matplotlib.text.Text.__init__`::
+`~matplotlib.axes.Axes.text` in simplified form looks like this, i.e., it just
+passes all ``args`` and ``kwargs`` on to ``matplotlib.text.Text.__init__``::
# in axes/_axes.py
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
t = Text(x=x, y=y, text=s, **kwargs)
-and :meth:`~matplotlib.text.Text.__init__` (again with liberties for
-illustration) just passes them on to the
-:meth:`matplotlib.artist.Artist.update` method::
+and ``matplotlib.text.Text.__init__`` (again with liberties for illustration)
+just passes them on to the `matplotlib.artist.Artist.update` method::
# in text.py
def __init__(self, x=0, y=0, text='', **kwargs):
@@ -471,10 +468,10 @@ local arguments and the rest are passed on as
Using logging for debug messages
--------------------------------
-Matplotlib uses the standard python `logging` library to write verbose
-warnings, information, and
-debug messages. Please use it! In all those places you write :func:`print()`
-statements to do your debugging, try using :func:`log.debug()` instead!
+Matplotlib uses the standard Python `logging` library to write verbose
+warnings, information, and debug messages. Please use it! In all those places
+you write `print` calls to do your debugging, try using `logging.debug`
+instead!
To include `logging` in your module, at the top of the module, you need to
@@ -489,8 +486,8 @@ To include `logging` in your module, at the top of the module, you need to
will log to a logger named ``matplotlib.yourmodulename``.
-If an end-user of Matplotlib sets up `logging` to display at levels
-more verbose than `logging.WARNING` in their code with the Matplotlib-provided
+If an end-user of Matplotlib sets up `logging` to display at levels more
+verbose than ``logging.WARNING`` in their code with the Matplotlib-provided
helper::
plt.set_loglevel("debug")
@@ -514,7 +511,7 @@ There are five levels at which you can emit messages.
- `logging.critical` and `logging.error` are really only there for errors that
will end the use of the library but not kill the interpreter.
-- `logging.warning` and `cbook._warn_external` are used to warn the user,
+- `logging.warning` and `.cbook._warn_external` are used to warn the user,
see below.
- `logging.info` is for information that the user may want to know if the
program behaves oddly. They are not displayed by default. For instance, if
@@ -527,22 +524,21 @@ There are five levels at which you can emit messages.
steps of layouting or rendering) should only log at this level.
By default, `logging` displays all log messages at levels higher than
-`logging.WARNING` to `sys.stderr`.
-
-The `logging tutorial`_ suggests that the difference
-between `logging.warning` and `cbook._warn_external` (which uses
-`warnings.warn`) is that `cbook._warn_external` should be used for things the
-user must change to stop the warning (typically in the source), whereas
-`logging.warning` can be more persistent. Moreover, note that
-`cbook._warn_external` will by default only emit a given warning *once* for
-each line of user code, whereas `logging.warning` will display the message
-every time it is called.
-
-By default, `warnings.warn` displays the line of code that has the `warn` call.
-This usually isn't more informative than the warning message itself. Therefore,
-Matplotlib uses `cbook._warn_external` which uses `warnings.warn`, but goes
-up the stack and displays the first line of code outside of Matplotlib.
-For example, for the module::
+``logging.WARNING`` to `sys.stderr`.
+
+The `logging tutorial`_ suggests that the difference between `logging.warning`
+and `.cbook._warn_external` (which uses `warnings.warn`) is that
+`.cbook._warn_external` should be used for things the user must change to stop
+the warning (typically in the source), whereas `logging.warning` can be more
+persistent. Moreover, note that `.cbook._warn_external` will by default only
+emit a given warning *once* for each line of user code, whereas
+`logging.warning` will display the message every time it is called.
+
+By default, `warnings.warn` displays the line of code that has the ``warn``
+call. This usually isn't more informative than the warning message itself.
+Therefore, Matplotlib uses `.cbook._warn_external` which uses `warnings.warn`,
+but goes up the stack and displays the first line of code outside of
+Matplotlib. For example, for the module::
# in my_matplotlib_module.py
import warnings
@@ -563,7 +559,7 @@ will display::
UserWarning: Attempting to set identical bottom==top
warnings.warn('Attempting to set identical bottom==top')
-Modifying the module to use `cbook._warn_external`::
+Modifying the module to use `.cbook._warn_external`::
from matplotlib import cbook
@@ -583,10 +579,9 @@ and running the same script will display::
Writing examples
----------------
-We have hundreds of examples in subdirectories of
-:file:`matplotlib/examples`, and these are automatically generated
-when the website is built to show up in the `examples
-<../gallery/index.html>` section of the website.
+We have hundreds of examples in subdirectories of :file:`matplotlib/examples`,
+and these are automatically generated when the website is built to show up in
+the :ref:`examples ` section of the website.
Any sample data that the example uses should be kept small and
distributed with Matplotlib in the
diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst
index 2fc16c57122d..008ad2cb934a 100644
--- a/doc/devel/testing.rst
+++ b/doc/devel/testing.rst
@@ -91,7 +91,7 @@ Writing a simple test
---------------------
Many elements of Matplotlib can be tested using standard tests. For
-example, here is a test from :mod:`matplotlib.tests.test_basic`::
+example, here is a test from :file:`matplotlib/tests/test_basic.py`::
def test_simple():
"""
@@ -105,7 +105,7 @@ begin with ``"test_"`` and then within those files for functions beginning with
Some tests have internal side effects that need to be cleaned up after their
execution (such as created figures or modified `.rcParams`). The pytest fixture
-:func:`~matplotlib.testing.conftest.mpl_test_settings` will automatically clean
+``matplotlib.testing.conftest.mpl_test_settings`` will automatically clean
these up; there is no need to do anything further.
Random data in tests
diff --git a/doc/missing-references.json b/doc/missing-references.json
index 98dc6913c6f6..e82a92889088 100644
--- a/doc/missing-references.json
+++ b/doc/missing-references.json
@@ -1,10 +1,4 @@
{
- "c:var": {
- "PyOS_InputHook": [
- "doc/users/interactive_guide.rst:401",
- "doc/users/interactive_guide.rst:411"
- ]
- },
"py:attr": {
"ax": [
"lib/mpl_toolkits/axes_grid1/colorbar.py:docstring of mpl_toolkits.axes_grid1.colorbar.ColorbarBase:23"
@@ -422,9 +416,6 @@
]
},
"py:func": {
- "log.debug": [
- "doc/devel/contributing.rst:450"
- ],
"matplotlib.Axis.set_ticks_position": [
"doc/users/prev_whats_new/whats_new_1.4.rst:141"
],
@@ -433,12 +424,6 @@
],
"matplotlib.axis.Tick.label1On": [
"doc/users/prev_whats_new/whats_new_2.1.0.rst:409"
- ],
- "matplotlib.test": [
- "doc/devel/testing.rst:79"
- ],
- "matplotlib.testing.conftest.mpl_test_settings": [
- "doc/devel/testing.rst:106"
]
},
"py:meth": {
@@ -447,9 +432,6 @@
"lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.SimplePatchShadow:42",
"lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.withSimplePatchShadow:51"
],
- "Colormap.__call__": [
- "lib/matplotlib/colors.py:docstring of matplotlib.colors.BoundaryNorm:44"
- ],
"FigureCanvasQTAgg.blit": [
"doc/api/prev_api_changes/api_changes_2.2.0.rst:199"
],
@@ -484,10 +466,6 @@
"_make_barbs": [
"lib/matplotlib/quiver.py:docstring of matplotlib.quiver.Barbs:9"
],
- "_process_colors": [
- "lib/matplotlib/contour.py:docstring of matplotlib.contour.ContourSet:64",
- "lib/matplotlib/contour.py:docstring of matplotlib.contour.QuadContourSet:30"
- ],
"autoscale_view": [
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.margins:32"
],
@@ -515,10 +493,6 @@
"matplotlib.patches.Rectangle.contains": [
"doc/users/event_handling.rst:164"
],
- "matplotlib.text.Text.__init__": [
- "doc/devel/contributing.rst:400",
- "doc/devel/contributing.rst:408"
- ],
"option_scale_image": [
"lib/matplotlib/backends/backend_cairo.py:docstring of matplotlib.backends.backend_cairo.RendererCairo.draw_image:22",
"lib/matplotlib/backends/backend_pdf.py:docstring of matplotlib.backends.backend_pdf.RendererPdf.draw_image:22",
@@ -565,15 +539,9 @@
],
"matplotlib.ft2font": [
"doc/api/prev_api_changes/api_changes_0.91.0.rst:34"
- ],
- "matplotlib.tests.test_basic": [
- "doc/devel/testing.rst:93"
]
},
"py:obj": {
- "./gallery/index.html": [
- "doc/devel/contributing.rst:562"
- ],
"Artist.stale_callback": [
"doc/users/interactive_guide.rst:326"
],
@@ -593,9 +561,6 @@
"lib/matplotlib/offsetbox.py:docstring of matplotlib.offsetbox.PackerBase:23",
"lib/matplotlib/offsetbox.py:docstring of matplotlib.offsetbox.VPacker:44"
],
- "Axes..set_inverted": [
- "doc/users/prev_whats_new/whats_new_3.1.0.rst:247"
- ],
"Axes.dataLim": [
"doc/api/axes_api.rst:302::1",
"lib/matplotlib/axes/_base.py:docstring of matplotlib.axes.Axes.update_datalim:2",
@@ -643,11 +608,6 @@
"Axis.units": [
"doc/api/prev_api_changes/api_changes_2.2.0.rst:77"
],
- "Canvas": [
- "doc/devel/MEP/MEP22.rst:56",
- "doc/devel/MEP/MEP22.rst:60",
- "doc/devel/MEP/MEP23.rst:70"
- ],
"ConnectionPatch": [
"doc/users/prev_whats_new/whats_new_3.1.0.rst:178"
],
@@ -661,15 +621,6 @@
"FigureCanvas": [
"lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolBase:25"
],
- "FigureManager": [
- "doc/devel/MEP/MEP23.rst:25",
- "doc/devel/MEP/MEP23.rst:62",
- "doc/devel/MEP/MEP23.rst:63",
- "doc/devel/MEP/MEP23.rst:65",
- "doc/devel/MEP/MEP23.rst:78",
- "doc/devel/MEP/MEP23.rst:85",
- "doc/devel/MEP/MEP23.rst:87"
- ],
"Formatter.__call__": [
"doc/api/prev_api_changes/api_changes_3.1.0.rst:1116",
"doc/api/prev_api_changes/api_changes_3.1.0.rst:1122"
@@ -681,9 +632,6 @@
"Glyph": [
"doc/gallery/misc/ftface_props.rst:16"
],
- "GraphicsContext": [
- "doc/devel/MEP/MEP26.rst:68"
- ],
"Image": [
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.gci:4"
],
@@ -709,30 +657,15 @@
"doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst:51",
"doc/api/prev_api_changes/api_changes_3.2.0/deprecations.rst:121"
],
- "Navigation": [
- "doc/devel/MEP/MEP22.rst:155",
- "doc/devel/MEP/MEP22.rst:60"
- ],
- "NavigationBase": [
- "doc/devel/MEP/MEP23.rst:90",
- "doc/devel/MEP/MEP23.rst:93"
- ],
"NavigationToolbar2QT.adj_window": [
"doc/api/prev_api_changes/api_changes_3.1.0.rst:962"
],
- "PolyCollection.get_offset": [
- "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes.Axes.hexbin:71",
- "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.hexbin:71"
- ],
"QuadContourSet.changed()": [
"lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes.Axes.contour:131",
"lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes.Axes.contourf:131",
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.contour:131",
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.contourf:131"
],
- "Quit": [
- "doc/devel/MEP/MEP22.rst:78"
- ],
"Quiver.pivot": [
"doc/api/prev_api_changes/api_changes_1.5.0.rst:44"
],
@@ -740,33 +673,10 @@
"lib/mpl_toolkits/axes_grid1/axes_grid.py:docstring of mpl_toolkits.axes_grid1.axes_grid.ImageGrid:61",
"lib/mpl_toolkits/axisartist/axes_grid.py:docstring of mpl_toolkits.axisartist.axes_grid.ImageGrid:61"
],
- "Style": [
- "doc/devel/MEP/MEP26.rst:68"
- ],
- "SubplotTool": [
- "doc/devel/MEP/MEP22.rst:78"
- ],
- "TextFont": [
- "doc/devel/MEP/MEP14.rst:267"
- ],
- "TextLayout": [
- "doc/devel/MEP/MEP14.rst:267",
- "doc/devel/MEP/MEP14.rst:376"
- ],
- "TextSpan": [
- "doc/devel/MEP/MEP14.rst:267"
- ],
- "TextSpans": [
- "doc/devel/MEP/MEP14.rst:267"
- ],
"Timer": [
"lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.FigureCanvasBase.new_timer:2",
"lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.TimerBase:14"
],
- "Tool": [
- "doc/devel/MEP/MEP22.rst:60",
- "doc/devel/MEP/MEP22.rst:96"
- ],
"ToolContainer": [
"doc/users/prev_whats_new/whats_new_1.5.rst:615",
"lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.ToolContainerBase.remove_toolitem:2",
@@ -775,18 +685,10 @@
"ToolContainers": [
"doc/users/prev_whats_new/whats_new_1.5.rst:615"
],
- "Toolbar": [
- "doc/devel/MEP/MEP22.rst:177",
- "doc/devel/MEP/MEP22.rst:56",
- "doc/devel/MEP/MEP22.rst:60",
- "doc/devel/MEP/MEP23.rst:46"
- ],
"Toolbars": [
"doc/users/prev_whats_new/whats_new_1.5.rst:615"
],
"Tools": [
- "doc/devel/MEP/MEP22.rst:40",
- "doc/devel/MEP/MEP22.rst:56",
"doc/users/prev_whats_new/whats_new_1.5.rst:608"
],
"_read": [
@@ -795,9 +697,6 @@
"active": [
"lib/matplotlib/widgets.py:docstring of matplotlib.widgets.AxesWidget:34"
],
- "add_canvas": [
- "doc/devel/MEP/MEP23.rst:62"
- ],
"add_subplot": [
"lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.subplot2grid:23"
],
@@ -890,23 +789,6 @@
"can_composite": [
"lib/matplotlib/image.py:docstring of matplotlib.image.composite_images:9"
],
- "canvas": [
- "doc/devel/MEP/MEP22.rst:140",
- "doc/devel/MEP/MEP23.rst:40"
- ],
- "cbook._warn_external": [
- "doc/devel/contributing.rst:493",
- "doc/devel/contributing.rst:508",
- "doc/devel/contributing.rst:517",
- "doc/devel/contributing.rst:542"
- ],
- "cbook.deprecated": [
- "doc/api/prev_api_changes/api_changes_3.1.0.rst:1074",
- "doc/api/prev_api_changes/api_changes_3.1.0.rst:766"
- ],
- "cbook.warn_deprecated": [
- "doc/api/prev_api_changes/api_changes_3.1.0.rst:766"
- ],
"cleanup": [
"lib/matplotlib/animation.py:docstring of matplotlib.animation.HTMLWriter.setup:19"
],
@@ -947,22 +829,10 @@
"gaussian_kde": [
"lib/matplotlib/mlab.py:docstring of matplotlib.mlab.GaussianKDE:32"
],
- "get_active_canvas": [
- "doc/devel/MEP/MEP23.rst:70"
- ],
- "get_canvas_title": [
- "doc/devel/MEP/MEP23.rst:68"
- ],
- "get_ps": [
- "doc/devel/MEP/MEP14.rst:376"
- ],
"get_size": [
"doc/users/prev_whats_new/whats_new_1.4.rst:223",
"lib/mpl_toolkits/axes_grid1/axes_size.py:docstring of mpl_toolkits.axes_grid1.axes_size:1"
],
- "get_spans": [
- "doc/devel/MEP/MEP14.rst:376"
- ],
"get_xbound": [
"lib/mpl_toolkits/mplot3d/axes3d.py:docstring of mpl_toolkits.mplot3d.axes3d.Axes3D.get_xlim3d:22"
],
@@ -1009,17 +879,6 @@
"load_char": [
"doc/gallery/misc/ftface_props.rst:16"
],
- "logging.WARNING": [
- "doc/devel/contributing.rst:468",
- "doc/devel/contributing.rst:505"
- ],
- "ls_mapper": [
- "doc/api/prev_api_changes/api_changes_1.5.0.rst:11"
- ],
- "ls_mapper_r": [
- "doc/api/prev_api_changes/api_changes_1.5.0.rst:11",
- "doc/api/prev_api_changes/api_changes_1.5.0.rst:8"
- ],
"mainloop": [
"lib/matplotlib/backends/backend_nbagg.py:docstring of matplotlib.backends.backend_nbagg.show:4"
],
@@ -1122,24 +981,24 @@
"doc/api/_as_gen/matplotlib.animation.AVConvWriter.rst:28::1"
],
"matplotlib.animation.ArtistAnimation.new_frame_seq": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
"matplotlib.animation.ArtistAnimation.new_saved_frame_seq": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
- "matplotlib.animation.ArtistAnimation.save": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1"
+ "matplotlib.animation.ArtistAnimation.pause": [
+ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
- "matplotlib.animation.ArtistAnimation.to_html5_video": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1"
+ "matplotlib.animation.ArtistAnimation.resume": [
+ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
- "matplotlib.animation.ArtistAnimation.to_jshtml": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1"
+ "matplotlib.animation.ArtistAnimation.save": [
+ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
- "matplotlib.animation.ArtistAnimation.pause": [
+ "matplotlib.animation.ArtistAnimation.to_html5_video": [
"doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
- "matplotlib.animation.ArtistAnimation.resume": [
+ "matplotlib.animation.ArtistAnimation.to_jshtml": [
"doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
],
"matplotlib.animation.FFMpegFileWriter.args_key": [
@@ -1232,6 +1091,12 @@
"matplotlib.animation.FileMovieWriter.saving": [
"doc/api/_as_gen/matplotlib.animation.FileMovieWriter.rst:28::1"
],
+ "matplotlib.animation.FuncAnimation.pause": [
+ "lib/matplotlib/animation.py:docstring of matplotlib.animation.FuncAnimation.new_frame_seq:1::1"
+ ],
+ "matplotlib.animation.FuncAnimation.resume": [
+ "lib/matplotlib/animation.py:docstring of matplotlib.animation.FuncAnimation.new_frame_seq:1::1"
+ ],
"matplotlib.animation.FuncAnimation.save": [
"lib/matplotlib/animation.py:docstring of matplotlib.animation.FuncAnimation.new_frame_seq:1::1"
],
@@ -1241,12 +1106,6 @@
"matplotlib.animation.FuncAnimation.to_jshtml": [
"lib/matplotlib/animation.py:docstring of matplotlib.animation.FuncAnimation.new_frame_seq:1::1"
],
- "matplotlib.animation.FuncAnimation.pause": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
- ],
- "matplotlib.animation.FuncAnimation.resume": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
- ],
"matplotlib.animation.HTMLWriter.bin_path": [
"doc/api/_as_gen/matplotlib.animation.HTMLWriter.rst:28::1"
],
@@ -1359,29 +1218,25 @@
"doc/api/_as_gen/matplotlib.animation.PillowWriter.rst:26::1"
],
"matplotlib.animation.TimedAnimation.new_frame_seq": [
- "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
],
"matplotlib.animation.TimedAnimation.new_saved_frame_seq": [
- "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
+ ],
+ "matplotlib.animation.TimedAnimation.pause": [
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
+ ],
+ "matplotlib.animation.TimedAnimation.resume": [
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
],
"matplotlib.animation.TimedAnimation.save": [
- "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
],
"matplotlib.animation.TimedAnimation.to_html5_video": [
- "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1"
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
],
"matplotlib.animation.TimedAnimation.to_jshtml": [
- "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1"
- ],
- "matplotlib.animation.TimedAnimation.pause": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
- ],
- "matplotlib.animation.TimedAnimation.resume": [
- "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1"
- ],
- "matplotlib.cbook.ls_mapper": [
- "doc/api/prev_api_changes/api_changes_1.5.0.rst:11",
- "doc/api/prev_api_changes/api_changes_1.5.0.rst:8"
+ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:23::1"
],
"matplotlib.colorbar.ColorbarBase.set_clim": [
"doc/api/prev_api_changes/api_changes_3.1.0.rst:290"
@@ -1395,12 +1250,6 @@
"matplotlib.dates.rrulewrapper": [
"lib/matplotlib/dates.py:docstring of matplotlib.dates:121"
],
- "matplotlib.docstring.dedent_interpd": [
- "doc/devel/documenting_mpl.rst:679"
- ],
- "matplotlib.patches.Patch.__init__": [
- "doc/devel/documenting_mpl.rst:712"
- ],
"matplotlib.sphinxext.mathmpl": [
"doc/users/prev_whats_new/whats_new_3.0.rst:225"
],
@@ -1420,9 +1269,6 @@
"matplotlib.testing.conftest.mpl_test_settings": [
"doc/api/prev_api_changes/api_changes_3.1.0.rst:942"
],
- "move_canvas": [
- "doc/devel/MEP/MEP23.rst:65"
- ],
"mpl_toolkits.axes_grid.axes_divider.AxesLocator": [
"lib/mpl_toolkits/axes_grid1/axes_divider.py:docstring of mpl_toolkits.axes_grid1.axes_divider.HBoxDivider.new_locator:2",
"lib/mpl_toolkits/axes_grid1/axes_divider.py:docstring of mpl_toolkits.axes_grid1.axes_divider.VBoxDivider.new_locator:2"
@@ -1430,13 +1276,6 @@
"mpl_toolkits.axislines.Axes": [
"lib/mpl_toolkits/axisartist/axis_artist.py:docstring of mpl_toolkits.axisartist.axis_artist:26"
],
- "new_figure_manager": [
- "doc/devel/MEP/MEP23.rst:75"
- ],
- "new_figure_manager_given_figure": [
- "doc/devel/MEP/MEP23.rst:78",
- "doc/devel/MEP/MEP23.rst:82"
- ],
"next_whats_new": [
"doc/users/next_whats_new/README.rst:6"
],
@@ -1444,7 +1283,6 @@
"doc/api/prev_api_changes/api_changes_2.1.0.rst:95",
"doc/faq/howto_faq.rst:18",
"doc/faq/howto_faq.rst:21",
- "doc/gallery/recipes/common_date_problems.rst:36",
"doc/gallery/text_labels_and_annotations/date.rst:20",
"doc/gallery/ticks_and_spines/date_precision_and_epochs.rst:16",
"doc/gallery/ticks_and_spines/date_precision_and_epochs.rst:190",
@@ -1474,9 +1312,6 @@
"pyplot.set_loglevel": [
"doc/users/prev_whats_new/whats_new_3.1.0.rst:377"
],
- "remove_canvas": [
- "doc/devel/MEP/MEP23.rst:63"
- ],
"rrulewrapper": [
"lib/matplotlib/dates.py:docstring of matplotlib.dates:121"
],
@@ -1490,12 +1325,6 @@
"self.vertices": [
"lib/matplotlib/path.py:docstring of matplotlib.path.Path.codes:2"
],
- "set_active_canvas": [
- "doc/devel/MEP/MEP23.rst:70"
- ],
- "set_canvas_title": [
- "doc/devel/MEP/MEP23.rst:66"
- ],
"set_size": [
"doc/users/prev_whats_new/whats_new_1.4.rst:223"
],
@@ -1510,18 +1339,9 @@
"lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.SimplePatchShadow:38",
"lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.withSimplePatchShadow:47"
],
- "show": [
- "doc/devel/MEP/MEP23.rst:70"
- ],
"size_vertical": [
"lib/mpl_toolkits/axes_grid1/anchored_artists.py:docstring of mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar:59"
],
- "sphinx-autogen": [
- "doc/devel/MEP/MEP10.rst:162"
- ],
- "sphinx-quickstart": [
- "doc/devel/MEP/MEP10.rst:170"
- ],
"streamplot.Grid": [
"doc/api/prev_api_changes/api_changes_3.1.0.rst:479"
],
@@ -1546,9 +1366,6 @@
"lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolFullScreen.enable:4",
"lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ZoomPanBase.trigger:2"
],
- "tool_added_event": [
- "doc/devel/MEP/MEP22.rst:171"
- ],
"tool_removed_event": [
"lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.ToolContainerBase.remove_toolitem:6"
],
@@ -1563,9 +1380,6 @@
"w_pad": [
"lib/matplotlib/figure.py:docstring of matplotlib.figure.Figure.set_constrained_layout:5"
],
- "warn": [
- "doc/devel/contributing.rst:517"
- ],
"whats_new.rst": [
"doc/users/next_whats_new/README.rst:6"
],
diff --git a/doc/sphinxext/missing_references.py b/doc/sphinxext/missing_references.py
index 1f4dd2b2fa90..e918834842fc 100644
--- a/doc/sphinxext/missing_references.py
+++ b/doc/sphinxext/missing_references.py
@@ -173,7 +173,7 @@ def _warn_unused_missing_references(app):
msg = (f"Reference {domain_type} {target} for "
f"{ignored_reference_location} can be removed"
f" from {app.config.missing_references_filename}."
- "It is no longer a missing reference in the docs.")
+ " It is no longer a missing reference in the docs.")
logger.warning(msg,
location=ignored_reference_location,
type='ref',
diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py
index 031d5a53a7b1..2b52dd414a03 100644
--- a/lib/matplotlib/cbook/__init__.py
+++ b/lib/matplotlib/cbook/__init__.py
@@ -483,7 +483,7 @@ def get_sample_data(fname, asfileobj=True, *, np_load=False):
def _get_data_path(*args):
"""
- Return the `Path` to a resource file provided by Matplotlib.
+ Return the `pathlib.Path` to a resource file provided by Matplotlib.
``*args`` specify a path relative to the base data path.
"""
@@ -989,7 +989,7 @@ def _combine_masks(*args):
Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf. No attempt is made to
- extract a mask from categories 2 and 4 if :meth:`np.isfinite`
+ extract a mask from categories 2 and 4 if `numpy.isfinite`
does not yield a Boolean array. Category 3 is included to
support RGB or RGBA ndarrays, which are assumed to have only
valid values and which are passed through unchanged.
@@ -1243,9 +1243,9 @@ def _compute_conf_interval(data, med, iqr, bootstrap):
return bxpstats
-# The ls_mapper maps short codes for line style to their full name used by
-# backends; the reverse mapper is for mapping full names to short ones.
+#: Maps short codes for line style to their full name used by backends.
ls_mapper = {'-': 'solid', '--': 'dashed', '-.': 'dashdot', ':': 'dotted'}
+#: Maps full names for line styles used by backends to their short codes.
ls_mapper_r = {v: k for k, v in ls_mapper.items()}
@@ -1349,7 +1349,7 @@ def _reshape_2D(X, name):
Use Fortran ordering to convert ndarrays and lists of iterables to lists of
1D arrays.
- Lists of iterables are converted by applying `np.asanyarray` to each of
+ Lists of iterables are converted by applying `numpy.asanyarray` to each of
their elements. 1D ndarrays are returned in a singleton list containing
them. 2D ndarrays are converted to the list of their *columns*.
@@ -2104,6 +2104,8 @@ def _warn_external(message, category=None):
function back to `warnings.warn`, i.e. ``cbook._warn_external =
warnings.warn`` (or ``functools.partial(warnings.warn, stacklevel=2)``,
etc.).
+
+ :meta public:
"""
frame = sys._getframe()
for stacklevel in itertools.count(1): # lgtm[py/unused-loop-variable]
diff --git a/lib/matplotlib/docstring.py b/lib/matplotlib/docstring.py
index 4fb2d59d326c..3b3b117d6529 100644
--- a/lib/matplotlib/docstring.py
+++ b/lib/matplotlib/docstring.py
@@ -54,6 +54,8 @@ def from_params(cls, params):
dictionary) and it may change before this class is called, one may
explicitly use a reference to the params rather than using *args or
**kwargs which will copy the values and not reference them.
+
+ :meta private:
"""
result = cls()
result.params = params
diff --git a/matplotlibrc.template b/matplotlibrc.template
index 87c7927ad3f8..a63e269068a1 100644
--- a/matplotlibrc.template
+++ b/matplotlibrc.template
@@ -2,20 +2,20 @@
## NOTE FOR END USERS: DO NOT EDIT THIS FILE!
##
-## This is a sample matplotlib configuration file - you can find a copy
+## This is a sample Matplotlib configuration file - you can find a copy
## of it on your system in site-packages/matplotlib/mpl-data/matplotlibrc
-## (which related to your Python installation location).
+## (relative to your Python installation location).
##
## You should find a copy of it on your system at
## site-packages/matplotlib/mpl-data/matplotlibrc (relative to your Python
## installation location). DO NOT EDIT IT!
##
## If you wish to change your default style, copy this file to one of the
-## following locations
-## unix/linux:
+## following locations:
+## Unix/Linux:
## $HOME/.config/matplotlib/matplotlibrc OR
## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set)
-## other platforms:
+## Other platforms:
## $HOME/.matplotlib/matplotlibrc
## and edit that copy.
##
@@ -31,8 +31,8 @@
## yields a valid style file.
##
## Colors: for the color values below, you can either use
-## - a matplotlib color string, such as r, k, or b
-## - an rgb tuple, such as (1.0, 0.5, 0.0)
+## - a Matplotlib color string, such as r, k, or b
+## - an RGB tuple, such as (1.0, 0.5, 0.0)
## - a hex string, such as ff00ff
## - a scalar grayscale intensity such as 0.75
## - a legal html color name, e.g., red, blue, darkslategray
@@ -76,7 +76,7 @@
## Qt5Cairo GTK3Cairo TkCairo WxCairo Cairo
## Qt4Agg Qt4Cairo Wx # deprecated.
## PS PDF SVG Template
-## You can also deploy your own backend outside of matplotlib by referring to
+## You can also deploy your own backend outside of Matplotlib by referring to
## the module name (which must be in the PYTHONPATH) as 'module://my_backend'.
#backend: Agg
@@ -90,7 +90,7 @@
## be tried until one that is available is found.
#webagg.port_retries: 50
-## When True, open the webbrowser to the plot that is shown
+## When True, open the web browser to the plot that is shown
#webagg.open_in_browser: True
## If you are running pyplot inside a GUI and your backend choice
@@ -240,11 +240,11 @@
## expanded, extra-expanded, ultra-expanded, wider, and narrower. This
## property is not currently implemented.
##
-## The font.size property is the default font size for text, given in pts.
+## The font.size property is the default font size for text, given in points.
## 10 pt is the standard value.
##
## Note that font.size controls default text sizes. To configure
-## special text sizes tick labels, axes, labels, title, etc, see the rc
+## special text sizes tick labels, axes, labels, title, etc., see the rc
## settings for axes and ticks. Special text sizes can be defined
## relative to font.size, using the following values: xx-small, x-small,
## small, medium, large, x-large, xx-large, larger, or smaller
@@ -275,7 +275,7 @@
## ***************************************************************************
## * LaTeX *
## ***************************************************************************
-## For more information on LaTex properties, see
+## For more information on LaTeX properties, see
## https://matplotlib.org/tutorials/text/usetex.html
#text.usetex: False # use latex for all text handling. The following fonts
# are supported through the usual rc parameter settings:
@@ -285,7 +285,7 @@
# computer modern sans serif, computer modern typewriter
# If another font is desired which can loaded using the
# LaTeX \usepackage command, please inquire at the
- # matplotlib mailing list
+ # Matplotlib mailing list
#text.latex.preamble: # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
@@ -351,22 +351,22 @@
## * AXES *
## ***************************************************************************
## Following are default face and edge colors, default tick sizes,
-## default fontsizes for ticklabels, and so on. See
+## default font sizes for tick labels, and so on. See
## https://matplotlib.org/api/axes_api.html#module-matplotlib.axes
#axes.facecolor: white # axes background color
#axes.edgecolor: black # axes edge color
-#axes.linewidth: 0.8 # edge linewidth
+#axes.linewidth: 0.8 # edge line width
#axes.grid: False # display grid or not
#axes.grid.axis: both # which axis the grid should apply to
-#axes.grid.which: major # gridlines at {major, minor, both} ticks
+#axes.grid.which: major # grid lines at {major, minor, both} ticks
#axes.titlelocation: center # alignment of the title: {left, right, center}
-#axes.titlesize: large # fontsize of the axes title
+#axes.titlesize: large # font size of the axes title
#axes.titleweight: normal # font weight of title
#axes.titlecolor: auto # color of the axes title, auto falls back to
# text.color as default value
#axes.titley: None # position title (axes relative units). None implies auto
#axes.titlepad: 6.0 # pad between axes and title in points
-#axes.labelsize: medium # fontsize of the x any y labels
+#axes.labelsize: medium # font size of the x and y labels
#axes.labelpad: 4.0 # space between label and axis
#axes.labelweight: normal # weight of the x and y labels
#axes.labelcolor: black
@@ -403,7 +403,7 @@
#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See
# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
#axes.prop_cycle: cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf'])
- # color cycle for plot lines as list of string colorspecs:
+ # color cycle for plot lines as list of string color specs:
# single letter, long name, or web-style hex
# As opposed to all other paramters in this file, the color
# values must be enclosed in quotes for this parameter,
@@ -416,7 +416,7 @@
#axes.xmargin: .05 # x margin. See `axes.Axes.margins`
#axes.ymargin: .05 # y margin. See `axes.Axes.margins`
#polaraxes.grid: True # display grid on polar axes
-#axes3d.grid: True # display grid on 3d axes
+#axes3d.grid: True # display grid on 3D axes
## ***************************************************************************
@@ -469,7 +469,7 @@
#xtick.minor.pad: 3.4 # distance to the minor tick label in points
#xtick.color: black # color of the ticks
#xtick.labelcolor: inherit # color of the tick labels or inherit from xtick.color
-#xtick.labelsize: medium # fontsize of the tick labels
+#xtick.labelsize: medium # font size of the tick labels
#xtick.direction: out # direction: {in, out, inout}
#xtick.minor.visible: False # visibility of minor ticks on x-axis
#xtick.major.top: True # draw x axis top major ticks
@@ -490,7 +490,7 @@
#ytick.minor.pad: 3.4 # distance to the minor tick label in points
#ytick.color: black # color of the ticks
#ytick.labelcolor: inherit # color of the tick labels or inherit from ytick.color
-#ytick.labelsize: medium # fontsize of the tick labels
+#ytick.labelsize: medium # font size of the tick labels
#ytick.direction: out # direction: {in, out, inout}
#ytick.minor.visible: False # visibility of minor ticks on y-axis
#ytick.major.left: True # draw y axis left major ticks
@@ -526,7 +526,7 @@
#legend.fontsize: medium
#legend.title_fontsize: None # None sets to the same as the default axes.
-## Dimensions as fraction of fontsize:
+## Dimensions as fraction of font size:
#legend.borderpad: 0.4 # border whitespace
#legend.labelspacing: 0.5 # the vertical space between the legend entries
#legend.handlelength: 2.0 # the length of the legend lines
@@ -544,8 +544,8 @@
#figure.titleweight: normal # weight of the figure title
#figure.figsize: 6.4, 4.8 # figure size in inches
#figure.dpi: 100 # figure dots per inch
-#figure.facecolor: white # figure facecolor
-#figure.edgecolor: white # figure edgecolor
+#figure.facecolor: white # figure face color
+#figure.edgecolor: white # figure edge color
#figure.frameon: True # enable figure frame
#figure.max_open_warning: 20 # The maximum number of figures to open through
# the pyplot interface before emitting a warning.
@@ -570,7 +570,7 @@
# elements fit on the figure. (Not
# compatible with `autolayout`, above).
#figure.constrained_layout.h_pad: 0.04167 # Padding around axes objects. Float representing
-#figure.constrained_layout.w_pad: 0.04167 # inches. Default is 3./72. inches (3 pts)
+#figure.constrained_layout.w_pad: 0.04167 # inches. Default is 3/72 inches (3 points)
#figure.constrained_layout.hspace: 0.02 # Space between subplot groups. Float representing
#figure.constrained_layout.wspace: 0.02 # a fraction of the subplot widths being separated.
@@ -595,9 +595,9 @@
## ***************************************************************************
#contour.negative_linestyle: dashed # string or on-off ink sequence
#contour.corner_mask: True # {True, False, legacy}
-#contour.linewidth: None # {float, None} Size of the contour
- # linewidths. If set to None,
- # it falls back to `line.linewidth`.
+#contour.linewidth: None # {float, None} Size of the contour line
+ # widths. If set to None, it falls back to
+ # `line.linewidth`.
## ***************************************************************************
@@ -659,12 +659,12 @@
## ***************************************************************************
## * SAVING FIGURES *
## ***************************************************************************
-## The default savefig params can be different from the display params
+## The default savefig parameters can be different from the display parameters
## e.g., you may want a higher resolution, or to make the figure
## background white
#savefig.dpi: figure # figure dots per inch or 'figure'
-#savefig.facecolor: auto # figure facecolor when saving
-#savefig.edgecolor: auto # figure edgecolor when saving
+#savefig.facecolor: auto # figure face color when saving
+#savefig.edgecolor: auto # figure edge color when saving
#savefig.format: png # {png, ps, pdf, svg}
#savefig.bbox: standard # {tight, standard}
# 'tight' is incompatible with pipe-based animation
@@ -682,7 +682,7 @@
### ps backend params
#ps.papersize: letter # {auto, letter, legal, ledger, A0-A10, B0-B10}
-#ps.useafm: False # use of afm fonts, results in small files
+#ps.useafm: False # use of AFM fonts, results in small files
#ps.usedistiller: False # {ghostscript, xpdf, None}
# Experimental: may produce smaller files.
# xpdf intended for production of publication quality files,
@@ -746,10 +746,10 @@
#animation.html: none # How to display the animation as HTML in
# the IPython notebook:
# - 'html5' uses HTML5 video tag
- # - 'jshtml' creates a Javascript animation
+ # - 'jshtml' creates a JavaScript animation
#animation.writer: ffmpeg # MovieWriter 'backend' to use
#animation.codec: h264 # Codec to use for writing movie
-#animation.bitrate: -1 # Controls size/quality tradeoff for movie.
+#animation.bitrate: -1 # Controls size/quality trade-off for movie.
# -1 implies let utility auto-determine
#animation.frame_format: png # Controls frame format used by temp files
#animation.ffmpeg_path: ffmpeg # Path to ffmpeg binary. Without full path