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

Skip to content

Commit 5f555f8

Browse files
authored
Merge pull request #16510 from anntzer/docmarkup
Doc markup cleanups.
2 parents 840a039 + 7dc356a commit 5f555f8

File tree

10 files changed

+40
-44
lines changed

10 files changed

+40
-44
lines changed

doc/users/dflt_style_changes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ abbreviated style string in ``plot``, however the new default colors
9595
are only specified via hex values. To access these colors outside of
9696
the property cycling the notation for colors ``'CN'``, where ``N``
9797
takes values 0-9, was added to
98-
denote the first 10 colors in ``mpl.rcParams['axes.prop_cycle']`` See
98+
denote the first 10 colors in :rc:`axes.prop_cycle`. See
9999
:doc:`/tutorials/colors/colors` for more details.
100100

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

1133-
With the default of ``rcParams['axes.formatter.useoffset'] = True``,
1133+
With the default :rc:`axes.formatter.useoffset`,
11341134
an offset will be used when it will save 4 or more digits. This can
11351135
be controlled with the new :rc:`axes.formatter.offset_threshold`.
11361136
To restore the previous behavior of using an offset to save 2 or more

doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

examples/color/color_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
6) a name from the `xkcd color survey <https://xkcd.com/color/rgb/>`__,
1717
prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``);
1818
7) a "Cn" color spec, i.e. ``'C'`` followed by a number, which is an index into
19-
the default property cycle (``matplotlib.rcParams['axes.prop_cycle']``); the
20-
indexing is intended to occur at rendering time, and defaults to black if
21-
the cycle does not include color.
19+
the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended
20+
to occur at rendering time, and defaults to black if the cycle does not
21+
include color.
2222
8) one of ``{'tab:blue', 'tab:orange', 'tab:green',
2323
'tab:red', 'tab:purple', 'tab:brown', 'tab:pink',
2424
'tab:gray', 'tab:olive', 'tab:cyan'}`` which are the Tableau Colors from the

examples/pyplots/fig_axes_customize_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import matplotlib.pyplot as plt
1010

1111
###############################################################################
12-
# ``plt.figure`` creates a ```matplotlib.figure.Figure`` instance
12+
# `.pyplot.figure` creates a `matplotlib.figure.Figure` instance.
1313

1414
fig = plt.figure()
1515
rect = fig.patch # a rectangle instance

tutorials/advanced/transforms_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
# ``transProjection`` handles the projection from the space,
548548
# e.g., latitude and longitude for map data, or radius and theta for polar
549549
# data, to a separable Cartesian coordinate system. There are several
550-
# projection examples in the ``matplotlib.projections`` package, and the
550+
# projection examples in the :mod:`matplotlib.projections` package, and the
551551
# best way to learn more is to open the source for those packages and
552552
# see how to make your own, since Matplotlib supports extensible axes
553553
# and projections. Michael Droettboom has provided a nice tutorial

tutorials/colors/colors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'}``
2727
(case-insensitive);
2828
* a "CN" color spec, i.e. ``'C'`` followed by a number, which is an index into
29-
the default property cycle (``matplotlib.rcParams['axes.prop_cycle']``); the
30-
indexing is intended to occur at rendering time, and defaults to black if the
31-
cycle does not include color.
29+
the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended
30+
to occur at rendering time, and defaults to black if the cycle does not
31+
include color.
3232
3333
.. _xkcd color survey: https://xkcd.com/color/rgb/
3434
@@ -81,7 +81,7 @@ def demo(sty):
8181

8282
###############################################################################
8383
# will use the first color for the title and then plot using the second
84-
# and third colors of each style's ``mpl.rcParams['axes.prop_cycle']``.
84+
# and third colors of each style's :rc:`axes.prop_cycle`.
8585
#
8686
#
8787
# .. _xkcd-colors:

tutorials/intermediate/color_cycle.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@
6767
plt.show()
6868

6969
###############################################################################
70-
# Setting ``prop_cycle`` in the ``matplotlibrc`` file or style files
71-
# ------------------------------------------------------------------
70+
# Setting ``prop_cycle`` in the :file:`matplotlibrc` file or style files
71+
# ----------------------------------------------------------------------
7272
#
73-
# Remember, if you want to set a custom cycler in your
74-
# ``.matplotlibrc`` file or a style file (``style.mplstyle``), you can set the
75-
# ``axes.prop_cycle`` property:
73+
# Remember, a custom cycler can be set in your :file:`matplotlibrc`
74+
# file or a style file (:file:`style.mplstyle`) under ``axes.prop_cycle``:
7675
#
7776
# .. code-block:: python
7877
#

tutorials/intermediate/tight_layout_guide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def example_plot(ax, fontsize=12):
5858
# Note that :func:`matplotlib.pyplot.tight_layout` will only adjust the
5959
# subplot params when it is called. In order to perform this adjustment each
6060
# time the figure is redrawn, you can call ``fig.set_tight_layout(True)``, or,
61-
# equivalently, set the ``figure.autolayout`` rcParam to ``True``.
61+
# equivalently, set :rc:`figure.autolayout` to ``True``.
6262
#
6363
# When you have multiple subplots, often you see labels of different
6464
# axes overlapping each other.

tutorials/introductory/usage.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,15 @@ def my_plotter(ax, data1, data2, param_dict):
290290
#
291291
# There are three ways to configure your backend:
292292
#
293-
# 1. The :rc:`backend` parameter in your ``matplotlibrc`` file
293+
# 1. The :rc:`backend` parameter in your :file:`matplotlibrc` file
294294
# 2. The :envvar:`MPLBACKEND` environment variable
295295
# 3. The function :func:`matplotlib.use`
296296
#
297297
# A more detailed description is given below.
298298
#
299299
# If multiple of these are configurations are present, the last one from the
300300
# list takes precedence; e.g. calling :func:`matplotlib.use()` will override
301-
# the setting in your ``matplotlibrc``.
301+
# the setting in your :file:`matplotlibrc`.
302302
#
303303
# If no backend is explicitly set, Matplotlib automatically detects a usable
304304
# backend based on what is available on your system and on whether a GUI event
@@ -308,7 +308,7 @@ def my_plotter(ax, data1, data2, param_dict):
308308
#
309309
# Here is a detailed description of the configuration methods:
310310
#
311-
# #. Setting :rc:`backend` in your ``matplotlibrc`` file::
311+
# #. Setting :rc:`backend` in your :file:`matplotlibrc` file::
312312
#
313313
# backend : qt5agg # use pyqt5 with antigrain (agg) rendering
314314
#
@@ -332,10 +332,10 @@ def my_plotter(ax, data1, data2, param_dict):
332332
# > python simple_plot.py
333333
#
334334
# Setting this environment variable will override the ``backend`` parameter
335-
# in *any* ``matplotlibrc``, even if there is a ``matplotlibrc`` in your
336-
# current working directory. Therefore, setting :envvar:`MPLBACKEND`
337-
# globally, e.g. in your ``.bashrc`` or ``.profile``, is discouraged as it
338-
# might lead to counter-intuitive behavior.
335+
# in *any* :file:`matplotlibrc`, even if there is a :file:`matplotlibrc` in
336+
# your current working directory. Therefore, setting :envvar:`MPLBACKEND`
337+
# globally, e.g. in your :file:`.bashrc` or :file:`.profile`, is discouraged
338+
# as it might lead to counter-intuitive behavior.
339339
#
340340
# #. If your script depends on a specific backend you can use the function
341341
# :func:`matplotlib.use`::
@@ -646,18 +646,15 @@ def my_plotter(ax, data1, data2, param_dict):
646646
# Line segment simplification
647647
# ---------------------------
648648
#
649-
# For plots that have line segments (e.g. typical line plots,
650-
# outlines of polygons, etc.), rendering performance can be
651-
# controlled by the ``path.simplify`` and
652-
# ``path.simplify_threshold`` parameters in your
653-
# ``matplotlibrc`` file (see
654-
# :doc:`/tutorials/introductory/customizing` for
655-
# more information about the ``matplotlibrc`` file).
656-
# The ``path.simplify`` parameter is a boolean indicating whether
657-
# or not line segments are simplified at all. The
658-
# ``path.simplify_threshold`` parameter controls how much line
659-
# segments are simplified; higher thresholds result in quicker
660-
# rendering.
649+
# For plots that have line segments (e.g. typical line plots, outlines
650+
# of polygons, etc.), rendering performance can be controlled by
651+
# :rc:`path.simplify` and :rc:`path.simplify_threshold`, which
652+
# can be defined e.g. in the :file:`matplotlibrc` file (see
653+
# :doc:`/tutorials/introductory/customizing` for more information about
654+
# the :file:`matplotlibrc` file). :rc:`path.simplify` is a boolean
655+
# indicating whether or not line segments are simplified at all.
656+
# :rc:`path.simplify_threshold` controls how much line segments are simplified;
657+
# higher thresholds result in quicker rendering.
661658
#
662659
# The following script will first display the data without any
663660
# simplification, and then display the same data with simplification.
@@ -683,7 +680,7 @@ def my_plotter(ax, data1, data2, param_dict):
683680
#
684681
# Matplotlib currently defaults to a conservative simplification
685682
# threshold of ``1/9``. If you want to change your default settings
686-
# to use a different value, you can change your ``matplotlibrc``
683+
# to use a different value, you can change your :file:`matplotlibrc`
687684
# file. Alternatively, you could create a new style for
688685
# interactive plotting (with maximal simplification) and another
689686
# style for publication quality plotting (with minimal

tutorials/text/annotations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@
329329
Placing Artist at the anchored location of the Axes
330330
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
331331
332-
There are classes of artists that can be placed at an anchored location
333-
in the Axes. A common example is the legend. This type of artist can
334-
be created by using the OffsetBox class. A few predefined classes are
335-
available in ``mpl_toolkits.axes_grid1.anchored_artists`` others in
336-
``matplotlib.offsetbox`` ::
332+
There are classes of artists that can be placed at an anchored
333+
location in the Axes. A common example is the legend. This type
334+
of artist can be created by using the `.OffsetBox` class. A few
335+
predefined classes are available in :mod:`matplotlib.offsetbox` and in
336+
:mod:`mpl_toolkits.axes_grid1.anchored_artists`. ::
337337
338338
from matplotlib.offsetbox import AnchoredText
339339
at = AnchoredText("Figure 1a",

0 commit comments

Comments
 (0)