Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Doc markup cleanups. #16510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/users/dflt_style_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ abbreviated style string in ``plot``, however the new default colors
are only specified via hex values. To access these colors outside of
the property cycling the notation for colors ``'CN'``, where ``N``
takes values 0-9, was added to
denote the first 10 colors in ``mpl.rcParams['axes.prop_cycle']`` See
denote the first 10 colors in :rc:`axes.prop_cycle`. See
:doc:`/tutorials/colors/colors` for more details.

To restore the old color cycle use
Expand Down Expand Up @@ -1130,7 +1130,7 @@ but cannot be controlled independently via `.rcParams`.
``ScalarFormatter`` tick label formatting with offsets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

With the default of ``rcParams['axes.formatter.useoffset'] = True``,
With the default :rc:`axes.formatter.useoffset`,
an offset will be used when it will save 4 or more digits. This can
be controlled with the new :rc:`axes.formatter.offset_threshold`.
To restore the previous behavior of using an offset to save 2 or more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

rcParams for controlling default "raise window" behavior
--------------------------------------------------------
The new config option ``rcParams['figure.raise_window']`` allows to disable
raising the plot window when calling ``plt.show`` or ``plt.pause`` methods.
The new config option :rc:`figure.raise_window` allows to disable
raising the plot window when calling `~.pyplot.show` or `~.pyplot.pause`.
``MacOSX`` backend is currently not supported.

6 changes: 3 additions & 3 deletions examples/color/color_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
6) a name from the `xkcd color survey <https://xkcd.com/color/rgb/>`__,
prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``);
7) a "Cn" color spec, i.e. ``'C'`` followed by a number, which is an index into
the default property cycle (``matplotlib.rcParams['axes.prop_cycle']``); the
indexing is intended to occur at rendering time, and defaults to black if
the cycle does not include color.
the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended
to occur at rendering time, and defaults to black if the cycle does not
include color.
8) one of ``{'tab:blue', 'tab:orange', 'tab:green',
'tab:red', 'tab:purple', 'tab:brown', 'tab:pink',
'tab:gray', 'tab:olive', 'tab:cyan'}`` which are the Tableau Colors from the
Expand Down
2 changes: 1 addition & 1 deletion examples/pyplots/fig_axes_customize_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import matplotlib.pyplot as plt

###############################################################################
# ``plt.figure`` creates a ```matplotlib.figure.Figure`` instance
# `.pyplot.figure` creates a `matplotlib.figure.Figure` instance.

fig = plt.figure()
rect = fig.patch # a rectangle instance
Expand Down
2 changes: 1 addition & 1 deletion tutorials/advanced/transforms_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
# ``transProjection`` handles the projection from the space,
# e.g., latitude and longitude for map data, or radius and theta for polar
# data, to a separable Cartesian coordinate system. There are several
# projection examples in the ``matplotlib.projections`` package, and the
# projection examples in the :mod:`matplotlib.projections` package, and the
# best way to learn more is to open the source for those packages and
# see how to make your own, since Matplotlib supports extensible axes
# and projections. Michael Droettboom has provided a nice tutorial
Expand Down
8 changes: 4 additions & 4 deletions tutorials/colors/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'}``
(case-insensitive);
* a "CN" color spec, i.e. ``'C'`` followed by a number, which is an index into
the default property cycle (``matplotlib.rcParams['axes.prop_cycle']``); the
indexing is intended to occur at rendering time, and defaults to black if the
cycle does not include color.
the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended
to occur at rendering time, and defaults to black if the cycle does not
include color.

.. _xkcd color survey: https://xkcd.com/color/rgb/

Expand Down Expand Up @@ -81,7 +81,7 @@ def demo(sty):

###############################################################################
# will use the first color for the title and then plot using the second
# and third colors of each style's ``mpl.rcParams['axes.prop_cycle']``.
# and third colors of each style's :rc:`axes.prop_cycle`.
#
#
# .. _xkcd-colors:
Expand Down
9 changes: 4 additions & 5 deletions tutorials/intermediate/color_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@
plt.show()

###############################################################################
# Setting ``prop_cycle`` in the ``matplotlibrc`` file or style files
# ------------------------------------------------------------------
# Setting ``prop_cycle`` in the :file:`matplotlibrc` file or style files
# ----------------------------------------------------------------------
#
# Remember, if you want to set a custom cycler in your
# ``.matplotlibrc`` file or a style file (``style.mplstyle``), you can set the
# ``axes.prop_cycle`` property:
# Remember, a custom cycler can be set in your :file:`matplotlibrc`
# file or a style file (:file:`style.mplstyle`) under ``axes.prop_cycle``:
#
# .. code-block:: python
#
Expand Down
2 changes: 1 addition & 1 deletion tutorials/intermediate/tight_layout_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def example_plot(ax, fontsize=12):
# Note that :func:`matplotlib.pyplot.tight_layout` will only adjust the
# subplot params when it is called. In order to perform this adjustment each
# time the figure is redrawn, you can call ``fig.set_tight_layout(True)``, or,
# equivalently, set the ``figure.autolayout`` rcParam to ``True``.
# equivalently, set :rc:`figure.autolayout` to ``True``.
#
# When you have multiple subplots, often you see labels of different
# axes overlapping each other.
Expand Down
37 changes: 17 additions & 20 deletions tutorials/introductory/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ def my_plotter(ax, data1, data2, param_dict):
#
# There are three ways to configure your backend:
#
# 1. The :rc:`backend` parameter in your ``matplotlibrc`` file
# 1. The :rc:`backend` parameter in your :file:`matplotlibrc` file
# 2. The :envvar:`MPLBACKEND` environment variable
# 3. The function :func:`matplotlib.use`
#
# A more detailed description is given below.
#
# If multiple of these are configurations are present, the last one from the
# list takes precedence; e.g. calling :func:`matplotlib.use()` will override
# the setting in your ``matplotlibrc``.
# the setting in your :file:`matplotlibrc`.
#
# If no backend is explicitly set, Matplotlib automatically detects a usable
# backend based on what is available on your system and on whether a GUI event
Expand All @@ -308,7 +308,7 @@ def my_plotter(ax, data1, data2, param_dict):
#
# Here is a detailed description of the configuration methods:
#
# #. Setting :rc:`backend` in your ``matplotlibrc`` file::
# #. Setting :rc:`backend` in your :file:`matplotlibrc` file::
#
# backend : qt5agg # use pyqt5 with antigrain (agg) rendering
#
Expand All @@ -332,10 +332,10 @@ def my_plotter(ax, data1, data2, param_dict):
# > python simple_plot.py
#
# Setting this environment variable will override the ``backend`` parameter
# in *any* ``matplotlibrc``, even if there is a ``matplotlibrc`` in your
# current working directory. Therefore, setting :envvar:`MPLBACKEND`
# globally, e.g. in your ``.bashrc`` or ``.profile``, is discouraged as it
# might lead to counter-intuitive behavior.
# in *any* :file:`matplotlibrc`, even if there is a :file:`matplotlibrc` in
# your current working directory. Therefore, setting :envvar:`MPLBACKEND`
# globally, e.g. in your :file:`.bashrc` or :file:`.profile`, is discouraged
# as it might lead to counter-intuitive behavior.
#
# #. If your script depends on a specific backend you can use the function
# :func:`matplotlib.use`::
Expand Down Expand Up @@ -646,18 +646,15 @@ def my_plotter(ax, data1, data2, param_dict):
# Line segment simplification
# ---------------------------
#
# For plots that have line segments (e.g. typical line plots,
# outlines of polygons, etc.), rendering performance can be
# controlled by the ``path.simplify`` and
# ``path.simplify_threshold`` parameters in your
# ``matplotlibrc`` file (see
# :doc:`/tutorials/introductory/customizing` for
# more information about the ``matplotlibrc`` file).
# The ``path.simplify`` parameter is a boolean indicating whether
# or not line segments are simplified at all. The
# ``path.simplify_threshold`` parameter controls how much line
# segments are simplified; higher thresholds result in quicker
# rendering.
# For plots that have line segments (e.g. typical line plots, outlines
# of polygons, etc.), rendering performance can be controlled by
# :rc:`path.simplify` and :rc:`path.simplify_threshold`, which
# can be defined e.g. in the :file:`matplotlibrc` file (see
# :doc:`/tutorials/introductory/customizing` for more information about
# the :file:`matplotlibrc` file). :rc:`path.simplify` is a boolean
# indicating whether or not line segments are simplified at all.
# :rc:`path.simplify_threshold` controls how much line segments are simplified;
# higher thresholds result in quicker rendering.
#
# The following script will first display the data without any
# simplification, and then display the same data with simplification.
Expand All @@ -683,7 +680,7 @@ def my_plotter(ax, data1, data2, param_dict):
#
# Matplotlib currently defaults to a conservative simplification
# threshold of ``1/9``. If you want to change your default settings
# to use a different value, you can change your ``matplotlibrc``
# to use a different value, you can change your :file:`matplotlibrc`
# file. Alternatively, you could create a new style for
# interactive plotting (with maximal simplification) and another
# style for publication quality plotting (with minimal
Expand Down
10 changes: 5 additions & 5 deletions tutorials/text/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@
Placing Artist at the anchored location of the Axes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are classes of artists that can be placed at an anchored location
in the Axes. A common example is the legend. This type of artist can
be created by using the OffsetBox class. A few predefined classes are
available in ``mpl_toolkits.axes_grid1.anchored_artists`` others in
``matplotlib.offsetbox`` ::
There are classes of artists that can be placed at an anchored
location in the Axes. A common example is the legend. This type
of artist can be created by using the `.OffsetBox` class. A few
predefined classes are available in :mod:`matplotlib.offsetbox` and in
:mod:`mpl_toolkits.axes_grid1.anchored_artists`. ::

from matplotlib.offsetbox import AnchoredText
at = AnchoredText("Figure 1a",
Expand Down