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

Skip to content

Commit 087b9f6

Browse files
committed
DOC: fix most cross references
1 parent af95fcb commit 087b9f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+146
-128
lines changed

.flake8

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ per-file-ignores =
5757
doc/conf.py: E402
5858
galleries/tutorials/advanced/path_tutorial.py: E402
5959
galleries/tutorials/advanced/patheffects_guide.py: E402
60-
galleries/tutorials/advanced/transforms_tutorial.py: E402, E501
61-
galleries/tutorials/colors/colormaps.py: E501
62-
galleries/tutorials/colors/colors.py: E402
60+
galleries/users_explain/artists/transforms_tutorial.py: E402, E501
61+
galleries/users_explain/colormaps.py: E501
62+
galleries/users_explain/colors/colors.py: E402
6363
galleries/tutorials/intermediate/artists.py: E402
64-
galleries/tutorials/intermediate/constrainedlayout_guide.py: E402
64+
galleries/users_explain/figure/constrainedlayout_guide.py: E402
6565
galleries/tutorials/intermediate/legend_guide.py: E402
66-
galleries/tutorials/intermediate/tight_layout_guide.py: E402
66+
galleries/users_explain/figure/tight_layout_guide.py: E402
6767
galleries/tutorials/introductory/animation_tutorial.py: E501
6868
galleries/tutorials/introductory/images.py: E501
6969
galleries/tutorials/introductory/pyplot.py: E402, E501

doc/api/prev_api_changes/api_changes_2.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ New dependency
99

1010
`kiwisolver <https://github.com/nucleic/kiwi>`__ is now a required
1111
dependency to support the new constrained_layout, see
12-
:doc:`/tutorials/intermediate/constrainedlayout_guide` for
12+
:ref:`constrainedlayout_guide` for
1313
more details.
1414

1515

doc/api/prev_api_changes/api_changes_3.4.0/behaviour.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ library, so using it should be safe, but layouts may not be exactly the same as
2424
more development takes place.
2525

2626
Details of using ``constrained_layout``, and its algorithm are available at
27-
:doc:`/tutorials/intermediate/constrainedlayout_guide`
27+
:ref:`constrainedlayout_guide`
2828

2929
``plt.subplot`` re-selection without keyword arguments
3030
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/devel/documenting_mpl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ Documents can be linked with the ``:doc:`` directive:
202202
203203
See the :doc:`/users/installing/index`
204204
205-
See the tutorial :doc:`/tutorials/introductory/quick_start`
205+
See the tutorial :ref:`quick_start`
206206
207207
See the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
208208
209209
will render as:
210210

211211
See the :doc:`/users/installing/index`
212212

213-
See the tutorial :doc:`/tutorials/introductory/quick_start`
213+
See the tutorial :ref:`quick_start`
214214

215215
See the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
216216

@@ -859,7 +859,7 @@ render as comments in :doc:`/gallery/lines_bars_and_markers/simple_plot`.
859859

860860
Tutorials are made with the exact same mechanism, except they are longer, and
861861
typically have more than one comment block (i.e.
862-
:doc:`/tutorials/introductory/quick_start`). The first comment block
862+
:ref:`quick_start`). The first comment block
863863
can be the same as the example above. Subsequent blocks of ReST text are
864864
delimited by the line ``# %%`` :
865865

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Learning resources
4949
Tutorials
5050
^^^
5151

52-
- :doc:`Quick-start guide <tutorials/introductory/quick_start>`
52+
- :ref:`Quick-start guide <quick_start>`
5353
- :doc:`Plot types <plot_types/index>`
5454
- :ref:`Introductory tutorials <tutorials-introductory>`
5555
- :doc:`External learning resources <users/resources/index>`

doc/users/faq/howto_faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ multiple ways to fix this:
183183
`.pyplot.subplots_adjust`.
184184
- Use one of the automatic layout mechanisms:
185185

186-
- constrained layout (:doc:`/tutorials/intermediate/constrainedlayout_guide`)
187-
- tight layout (:doc:`/tutorials/intermediate/tight_layout_guide`)
186+
- constrained layout (:ref:`constrainedlayout_guide`)
187+
- tight layout (:ref:`tight_layout_guide`)
188188

189189
- Calculate good values from the size of the plot elements yourself
190190
(:doc:`/gallery/subplots_axes_and_figures/auto_subplots_adjust`)

doc/users/getting_started/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ Where to go next
5151

5252
- Check out :doc:`Plot types </plot_types/index>` to get an overview of the
5353
types of plots you can create with Matplotlib.
54-
- Learn Matplotlib from the ground up in the
55-
:doc:`Quick-start guide </tutorials/introductory/quick_start>`.
54+
- Learn Matplotlib from the ground up in the :ref:`Quick-start guide
55+
<quick_start>`.

doc/users/prev_whats_new/dflt_style_changes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ are only specified via hex values. To access these colors outside of
9898
the property cycling the notation for colors ``'CN'``, where ``N``
9999
takes values 0-9, was added to
100100
denote the first 10 colors in :rc:`axes.prop_cycle`. See
101-
:doc:`/tutorials/colors/colors` for more details.
101+
:ref:`colors_def` for more details.
102102

103103
To restore the old color cycle use
104104

@@ -147,7 +147,7 @@ watch Nathaniel Smith and Stéfan van der Walt's talk from SciPy2015.
147147
See `here for many more details <https://bids.github.io/colormap/>`__
148148
about the other alternatives and the tools used to create the color
149149
map. For details on all of the colormaps available in matplotlib see
150-
:doc:`/tutorials/colors/colormaps`.
150+
:ref:`colormaps`.
151151

152152
.. raw:: html
153153

doc/users/prev_whats_new/whats_new_0.99.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Jae-Joon Lee has written two new guides :doc:`/tutorials/intermediate/legend_gui
1515
and :ref:`plotting-guide-annotation`. Michael Sarahan has written
1616
:doc:`/tutorials/introductory/images`. John Hunter has written two new tutorials on
1717
working with paths and transformations: :doc:`/tutorials/advanced/path_tutorial` and
18-
:doc:`/tutorials/advanced/transforms_tutorial`.
18+
:doc:`transforms_tutorial`.
1919

2020
.. _whats-new-mplot3d:
2121

doc/users/prev_whats_new/whats_new_1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Sophisticated subplot grid layout
2323

2424
Jae-Joon Lee has written :mod:`~matplotlib.gridspec`, a new module for
2525
doing complex subplot layouts, featuring row and column spans and
26-
more. See :doc:`/tutorials/intermediate/arranging_axes` for a tutorial
26+
more. See :ref:`arranging_axes` for a tutorial
2727
overview.
2828

2929
.. figure:: ../../gallery/userdemo/images/sphx_glr_demo_gridspec01_001.png

doc/users/prev_whats_new/whats_new_1.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The usage of this functionality can be as simple as ::
8585

8686
and it will adjust the spacing between subplots
8787
so that the axis labels do not overlap with neighboring subplots. A
88-
:doc:`/tutorials/intermediate/tight_layout_guide` has been created to show how to use
88+
:ref:`tight_layout_guide` has been created to show how to use
8989
this new tool.
9090

9191
PyQT4, PySide, and IPython

doc/users/prev_whats_new/whats_new_2.2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Features include:
3232
- Nested `~.GridSpec` layouts using `~.GridSpecFromSubplotSpec`.
3333

3434
For more details and capabilities please see the new tutorial:
35-
:doc:`/tutorials/intermediate/constrainedlayout_guide`
35+
:ref:`constrainedlayout_guide`
3636

3737
Note the new API to access this:
3838

doc/users/prev_whats_new/whats_new_3.3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ or as a string (with single-character Axes labels):
5050
ha='center', va='center', fontsize=36,
5151
color='darkgrey')
5252

53-
See :doc:`/gallery/subplots_axes_and_figures/mosaic` for more details and examples.
53+
See :ref:`mosaic` for more details and examples.
5454

5555
``GridSpec.subplots()``
5656
-----------------------

doc/users/prev_whats_new/whats_new_3.4.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ If the center of symmetry is different from 0, it can be set with the *vcenter*
582582
argument. To manually set the range of `~.matplotlib.colors.CenteredNorm`, use
583583
the *halfrange* argument.
584584

585-
See :doc:`/tutorials/colors/colormapnorms` for an example and more details
585+
See :ref:`colormapnorms` for an example and more details
586586
about data normalization.
587587

588588
New ``FuncNorm`` for arbitrary normalizations
@@ -617,7 +617,7 @@ forward and inverse.
617617
size=16, va='center', ha='center')
618618
plt.show()
619619

620-
See :doc:`/tutorials/colors/colormapnorms` for an example and more details
620+
See :ref:`colormapnorms` for an example and more details
621621
about data normalization.
622622

623623
GridSpec-based colorbars can now be positioned above or to the left of the main axes

galleries/examples/color/color_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
For more information on colors in matplotlib see
3232
33-
* the :doc:`/tutorials/colors/colors` tutorial;
33+
* the :ref:`colors_def` tutorial;
3434
* the `matplotlib.colors` API;
3535
* the :doc:`/gallery/color/named_colors` example.
3636
"""

galleries/examples/color/colormap_reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
A reversed version of each of these colormaps is available by appending
99
``_r`` to the name, as shown in :ref:`reverse-cmap`.
1010
11-
See :doc:`/tutorials/colors/colormaps` for an in-depth discussion about
11+
See :ref:`colormaps` for an in-depth discussion about
1212
colormaps, including colorblind-friendliness, and
13-
:doc:`/tutorials/colors/colormap-manipulation` for a guide to creating
13+
:ref:`colormap-manipulation` for a guide to creating
1414
colormaps.
1515
"""
1616

galleries/examples/color/custom_cmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
=========================================
55
66
For more detail on creating and manipulating colormaps see
7-
:doc:`/tutorials/colors/colormap-manipulation`.
7+
:ref:`colormap-manipulation`.
88
9-
Creating a :doc:`colormap </tutorials/colors/colormaps>` from a list of colors
9+
Creating a :ref:`colormap <colormaps>` from a list of colors
1010
can be done with the `.LinearSegmentedColormap.from_list` method. You must
1111
pass a list of RGB tuples that define the mixture of colors from 0 to 1.
1212

galleries/examples/color/named_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This plots a list of the named colors supported in matplotlib.
77
For more information on colors in matplotlib see
88
9-
* the :doc:`/tutorials/colors/colors` tutorial;
9+
* the :ref:`colors_def` tutorial;
1010
* the `matplotlib.colors` API;
1111
* the :doc:`/gallery/color/color_demo`.
1212

galleries/examples/images_contours_and_fields/contour_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
1010
The emphasis in this demo is on showing how to make contours register
1111
correctly on images, and on how to get both of them oriented as desired.
12-
In particular, note the usage of the :doc:`"origin" and "extent"
13-
</tutorials/intermediate/imshow_extent>` keyword arguments to imshow and
12+
In particular, note the usage of the :ref:`"origin" and "extent"
13+
<imshow_extent>` keyword arguments to imshow and
1414
contour.
1515
"""
1616
import matplotlib.pyplot as plt

galleries/examples/images_contours_and_fields/image_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@
134134
# x[0, 0] in the upper left or lower right by using the origin parameter.
135135
# You can also control the default setting image.origin in your
136136
# :ref:`matplotlibrc file <customizing-with-matplotlibrc-files>`. For more on
137-
# this topic see the :doc:`complete guide on origin and extent
138-
# </tutorials/intermediate/imshow_extent>`.
137+
# this topic see the :ref:`complete guide on origin and extent
138+
# <imshow_extent>`.
139139

140140
x = np.arange(120).reshape((10, 12))
141141

galleries/examples/lines_bars_and_markers/scatter_hist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def scatter_hist(x, y, ax, ax_histx, ax_histy):
6060
# --------------------------------------------
6161
#
6262
# We define a gridspec with unequal width- and height-ratios to achieve desired
63-
# layout. Also see the :doc:`/tutorials/intermediate/arranging_axes` tutorial.
63+
# layout. Also see the :ref:`arranging_axes` tutorial.
6464

6565
# Start with a square Figure.
6666
fig = plt.figure(figsize=(6, 6))

galleries/examples/subplots_axes_and_figures/auto_subplots_adjust.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
almost always simpler and good enough to either set the subplot parameters
1313
manually using `.Figure.subplots_adjust`, or use one of the automatic
1414
layout mechanisms
15-
(:doc:`/tutorials/intermediate/constrainedlayout_guide` or
16-
:doc:`/tutorials/intermediate/tight_layout_guide`).
15+
(:ref:`constrainedlayout_guide` or
16+
:ref:`tight_layout_guide`).
1717
1818
This example describes a user-defined way to read out Artist sizes and
1919
set the subplot parameters accordingly. Its main purpose is to illustrate

galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
a figure so that there are no overlaps between axes objects and labels
88
on the axes.
99
10-
See :doc:`/tutorials/intermediate/constrainedlayout_guide` for more details and
11-
:doc:`/tutorials/intermediate/tight_layout_guide` for an alternative.
10+
See :ref:`constrainedlayout_guide` for more details and
11+
:ref:`tight_layout_guide` for an alternative.
1212
1313
"""
1414

galleries/examples/subplots_axes_and_figures/demo_tight_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
`~.Figure.tight_layout` attempts to resize subplots in a figure so that there
77
are no overlaps between axes objects and labels on the axes.
88
9-
See :doc:`/tutorials/intermediate/tight_layout_guide` for more details and
10-
:doc:`/tutorials/intermediate/constrainedlayout_guide` for an alternative.
9+
See :ref:`tight_layout_guide` for more details and
10+
:ref:`constrainedlayout_guide` for an alternative.
1111
1212
"""
1313

galleries/examples/subplots_axes_and_figures/gridspec_and_subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
To start with this layout (rather than removing the overlapping axes) use
1212
`~.pyplot.subplot_mosaic`.
1313
14-
See also :doc:`/tutorials/intermediate/arranging_axes`.
14+
See also :ref:`arranging_axes`.
1515
"""
1616

1717
import matplotlib.pyplot as plt

galleries/examples/text_labels_and_annotations/angle_annotation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* It provides a ready-to-use solution for the problem of easily drawing angles
2222
in graphs.
2323
* It shows how to subclass a Matplotlib artist to enhance its functionality, as
24-
well as giving a hands-on example on how to use Matplotlib's :doc:`transform
25-
system </tutorials/advanced/transforms_tutorial>`.
24+
well as giving a hands-on example on how to use Matplotlib's :ref:`transform
25+
system <transforms_tutorial>`.
2626
2727
If mainly interested in the former, you may copy the below class and jump to
2828
the :ref:`angle-annotation-usage` section.

galleries/examples/text_labels_and_annotations/placing_text_boxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
==================
44
55
When decorating axes with text boxes, two useful tricks are to place the text
6-
in axes coordinates (see :doc:`/tutorials/advanced/transforms_tutorial`),
6+
in axes coordinates (see :ref:`transforms_tutorial`),
77
so the text doesn't move around with changes in x or y limits. You
88
can also use the ``bbox`` property of text to surround the text with a
99
`~matplotlib.patches.Patch` instance -- the ``bbox`` keyword argument takes a

galleries/tutorials/intermediate/legend_guide.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""
2+
.. _legend_guide:
3+
24
============
35
Legend guide
46
============

galleries/tutorials/introductory/images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
experimenting with various plot settings. The alternative is the explicit,
4343
which is more suitable for large application development. For an explanation
4444
of the tradeoffs between the implicit and explicit interfaces see
45-
:ref:`api_interfaces` and the :doc:`Quick start guide
46-
</tutorials/introductory/quick_start>` to start using the explicit interface.
45+
:ref:`api_interfaces` and the :ref:`Quick start guide
46+
<quick_start>` to start using the explicit interface.
4747
For now, let's get on with the implicit approach:
4848
4949
"""

galleries/tutorials/introductory/lifecycle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
# .. note::
8686
#
8787
# Figures can have multiple axes on them. For information on how to do this,
88-
# see the :doc:`Tight Layout tutorial
89-
# </tutorials/intermediate/tight_layout_guide>`.
88+
# see the :ref:`Tight Layout tutorial
89+
# <tight_layout_guide>`.
9090

9191
fig, ax = plt.subplots()
9292

galleries/tutorials/introductory/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
===============
55
66
An introduction to the pyplot interface. Please also see
7-
:doc:`/tutorials/introductory/quick_start` for an overview of how Matplotlib
7+
:ref:`quick_start` for an overview of how Matplotlib
88
works and :ref:`api_interfaces` for an explanation of the trade-offs between the
99
supported user APIs.
1010

galleries/tutorials/text/annotations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def custom_box_style(x0, y0, width, height, mutation_size):
559559
# Some others more advanced options are:
560560
#
561561
# 1. A `.Transform` instance. For more information on transforms, see the
562-
# :doc:`../advanced/transforms_tutorial` For example, the
562+
# :ref:`transforms_tutorial` For example, the
563563
# ``Axes.transAxes`` transform positions the annotation relative to the Axes
564564
# coordinates and using it is therefore identical to setting the
565565
# coordinate system to "axes fraction":
@@ -689,7 +689,7 @@ def custom_box_style(x0, y0, width, height, mutation_size):
689689
# (with `~.Figure.add_artist`) rather than to either axes. This ensures that
690690
# the ConnectionPatch artist is drawn on top of both axes, and is also necessary
691691
# when using :doc:`constrained_layout
692-
# </tutorials/intermediate/constrainedlayout_guide>` for positioning the axes.
692+
# <:ref:`constrainedlayout_guide`>` for positioning the axes.
693693
#
694694
# Zoom effect between Axes
695695
# ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -703,5 +703,5 @@ def custom_box_style(x0, y0, width, height, mutation_size):
703703
#
704704
# The code for this figure is at
705705
# :doc:`/gallery/subplots_axes_and_figures/axes_zoom_effect` and
706-
# familiarity with :doc:`../advanced/transforms_tutorial`
706+
# familiarity with :ref:`transforms_tutorial`
707707
# is recommended.

galleries/tutorials/text/text_props.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
Property Value Type
1414
========================== ======================================================================================================================
1515
alpha `float`
16-
backgroundcolor any matplotlib :doc:`color </tutorials/colors/colors>`
16+
backgroundcolor any matplotlib :ref:`color <colors_def>`
1717
bbox `~matplotlib.patches.Rectangle` prop dict plus key ``'pad'`` which is a pad in points
1818
clip_box a matplotlib.transform.Bbox instance
1919
clip_on bool
2020
clip_path a `~matplotlib.path.Path` instance and a `~matplotlib.transforms.Transform` instance, a `~matplotlib.patches.Patch`
21-
color any matplotlib :doc:`color </tutorials/colors/colors>`
21+
color any matplotlib :ref:`color <colors_def>`
2222
family [ ``'serif'`` | ``'sans-serif'`` | ``'cursive'`` | ``'fantasy'`` | ``'monospace'`` ]
2323
fontproperties `~matplotlib.font_manager.FontProperties`
2424
horizontalalignment or ha [ ``'center'`` | ``'right'`` | ``'left'`` ]

galleries/users_explain/artists/imshow_extent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
.. redirect-from:: /tutorials/intermediate/imshow_extent
33
4+
.. _imshow_extent:
5+
46
*origin* and *extent* in `~.Axes.imshow`
57
========================================
68

0 commit comments

Comments
 (0)