Skip to content

Commit bded7cb

Browse files
committed
Replace :ref:sphx_glr_... by :doc:/....
The latter form is shorter, not specific to sphinx-gallery, maps more cleanly to the actual path (no confusion between underscores and slashes), and links to the example page itself rather than an anchor just below it. Done by sed + manual checking.
1 parent 0334c04 commit bded7cb

Some content is hidden

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

56 files changed

+105
-105
lines changed

doc/api/api_changes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ New dependency
3030

3131
`kiwisolver <https://github.com/nucleic/kiwi>`__ is now a required
3232
dependency to support the new constrained_layout, see
33-
:ref:`sphx_glr_tutorials_intermediate_constrainedlayout_guide.py` for
33+
:doc:`/tutorials/intermediate/constrainedlayout_guide` for
3434
more details.
3535

3636

@@ -1603,7 +1603,7 @@ original location:
16031603
* The legend handler interface has changed from a callable, to any object
16041604
which implements the ``legend_artists`` method (a deprecation phase will
16051605
see this interface be maintained for v1.4). See
1606-
:ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for further details. Further legend changes
1606+
:doc:`/tutorials/intermediate/legend_guide` for further details. Further legend changes
16071607
include:
16081608

16091609
* :func:`matplotlib.axes.Axes._get_legend_handles` now returns a generator

doc/api/pyplot_summary.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Pyplot API
88
The :mod:`matplotlib.pyplot` module contains functions that allow you to generate
99
many kinds of plots quickly. For examples that showcase the use
1010
of the :mod:`matplotlib.pyplot` module, see the
11-
:ref:`sphx_glr_tutorials_introductory_pyplot.py`
11+
:doc:`/tutorials/introductory/pyplot`
1212
or the :ref:`pyplots_examples`. We also recommend that you look into
1313
the object-oriented approach to plotting, described below.
1414

@@ -38,6 +38,6 @@ There are many colormaps you can use to map data onto color values.
3838
Below we list several ways in which color can be utilized in Matplotlib.
3939

4040
For a more in-depth look at colormaps, see the
41-
:ref:`sphx_glr_tutorials_colors_colormaps.py` tutorial.
41+
:doc:`/tutorials/colors/colormaps` tutorial.
4242

4343
.. autofunction:: colormaps

doc/api/toolkits/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mplot3d
2121
plotting (scatter, surf, line, mesh) tools. Not the fastest or most feature
2222
complete 3D library out there, but it ships with Matplotlib and thus may be a
2323
lighter weight solution for some use cases. Check out the
24-
:ref:`mplot3d tutorial <sphx_glr_tutorials_toolkits_mplot3d.py>` for more
24+
:doc:`mplot3d tutorial </tutorials/toolkits/mplot3d>` for more
2525
information.
2626

2727
.. figure:: ../../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png

doc/api/toolkits/mplot3d/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The mplot3d toolkit adds simple 3D plotting capabilities to matplotlib by
1111
supplying an axes object that can create a 2D projection of a 3D scene.
1212
The resulting graph will have the same look and feel as regular 2D plots.
1313

14-
See the :ref:`mplot3d tutorial <sphx_glr_tutorials_toolkits_mplot3d.py>` for
14+
See the :doc:`mplot3d tutorial </tutorials/toolkits/mplot3d>` for
1515
more information on how to use this toolkit.
1616

1717
.. image:: /_static/demo_mplot3d.png

doc/devel/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ Developing a new backend
479479
------------------------
480480

481481
If you are working on a custom backend, the *backend* setting in
482-
:file:`matplotlibrc` (:ref:`sphx_glr_tutorials_introductory_customizing.py`) supports an
482+
:file:`matplotlibrc` (:doc:`/tutorials/introductory/customizing`) supports an
483483
external backend via the ``module`` directive. If
484484
:file:`my_backend.py` is a Matplotlib backend in your
485485
:envvar:`PYTHONPATH`, you can set it on one of several ways

doc/faq/howto_faq.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you only want to use the `pandas` converter for `datetime64` values ::
4343
Find all objects in a figure of a certain type
4444
----------------------------------------------
4545

46-
Every Matplotlib artist (see :ref:`sphx_glr_tutorials_intermediate_artists.py`) has a method
46+
Every Matplotlib artist (see :doc:`/tutorials/intermediate/artists`) has a method
4747
called :meth:`~matplotlib.artist.Artist.findobj` that can be used to
4848
recursively search the artist for any artists it may contain that meet
4949
some criteria (e.g., match all :class:`~matplotlib.lines.Line2D`
@@ -159,7 +159,7 @@ labels::
159159
ax = fig.add_subplot(111)
160160

161161
You can control the defaults for these parameters in your
162-
:file:`matplotlibrc` file; see :ref:`sphx_glr_tutorials_introductory_customizing.py`. For
162+
:file:`matplotlibrc` file; see :doc:`/tutorials/introductory/customizing`. For
163163
example, to make the above setting permanent, you would set::
164164

165165
figure.subplot.bottom : 0.2 # the bottom of the subplots of the figure
@@ -190,7 +190,7 @@ specify the location explicitly::
190190
ax = fig.add_axes([left, bottom, width, height])
191191

192192
where all values are in fractional (0 to 1) coordinates. See
193-
:ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_demo.py` for an example of placing axes manually.
193+
:doc:`/gallery/subplots_axes_and_figures/axes_demo` for an example of placing axes manually.
194194

195195
.. _howto-auto-adjust:
196196

@@ -200,7 +200,7 @@ Automatically make room for tick labels
200200
.. note::
201201
This is now easier to handle than ever before.
202202
Calling :func:`~matplotlib.pyplot.tight_layout` can fix many common
203-
layout issues. See the :ref:`sphx_glr_tutorials_intermediate_tight_layout_guide.py`.
203+
layout issues. See the :doc:`/tutorials/intermediate/tight_layout_guide`.
204204

205205
The information below is kept here in case it is useful for other
206206
purposes.
@@ -352,7 +352,7 @@ and patches, respectively::
352352

353353
.. only:: html
354354

355-
See :ref:`sphx_glr_gallery_misc_zorder_demo.py` for a complete example.
355+
See :doc:`/gallery/misc/zorder_demo` for a complete example.
356356

357357
You can also use the Axes property
358358
:meth:`~matplotlib.axes.Axes.set_axisbelow` to control whether the grid
@@ -371,7 +371,7 @@ some ratio which controls the ratio::
371371

372372
.. only:: html
373373

374-
See :ref:`sphx_glr_gallery_subplots_axes_and_figures_axis_equal_demo.py` for a
374+
See :doc:`/gallery/subplots_axes_and_figures/axis_equal_demo` for a
375375
complete example.
376376

377377
.. _howto-twoscale:
@@ -415,7 +415,7 @@ locators as desired because the two axes are independent.
415415

416416
.. only:: html
417417

418-
See :ref:`sphx_glr_gallery_api_two_scales.py` for a complete example
418+
See :doc:`/gallery/api/two_scales` for a complete example
419419

420420
.. _howto-batch:
421421

@@ -661,7 +661,7 @@ For more on configuring your backend, see
661661

662662
Alternatively, you can avoid pylab/pyplot altogether, which will give
663663
you a little more control, by calling the API directly as shown in
664-
:ref:`sphx_glr_gallery_api_agg_oo_sgskip.py`.
664+
:doc:`/gallery/api/agg_oo_sgskip`.
665665

666666
You can either generate hardcopy on the filesystem by calling savefig::
667667

doc/faq/installing_faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ example::
2626

2727
This will give you additional information about which backends matplotlib is
2828
loading, version information, and more. At this point you might want to make
29-
sure you understand matplotlib's :ref:`configuration <sphx_glr_tutorials_introductory_customizing.py>`
29+
sure you understand matplotlib's :doc:`configuration </tutorials/introductory/customizing>`
3030
process, governed by the :file:`matplotlibrc` configuration file which contains
3131
instructions within and the concept of the matplotlib backend.
3232

doc/faq/troubleshooting_faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ provide the following information in your e-mail to the `mailing list
104104
`Enthought Canopy <https://www.enthought.com/products/canopy/>`_).
105105

106106
* Any customizations to your ``matplotlibrc`` file (see
107-
:ref:`sphx_glr_tutorials_introductory_customizing.py`).
107+
:doc:`/tutorials/introductory/customizing`).
108108

109109
* If the problem is reproducible, please try to provide a *minimal*, standalone
110110
Python script that demonstrates the problem. This is *the* critical step.

doc/users/dflt_style_changes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ 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
9898
denote the first 10 colors in ``mpl.rcParams['axes.prop_cycle']`` See
99-
:ref:`sphx_glr_tutorials_colors_colors.py` for more details.
99+
:doc:`/tutorials/colors/colors` for more details.
100100

101101
To restore the old color cycle use
102102

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

150150
.. raw:: html
151151

doc/users/prev_whats_new/whats_new_0.98.4.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ psd amplitude scaling
7979

8080
Ryan May did a lot of work to rationalize the amplitude scaling of
8181
:func:`~matplotlib.pyplot.psd` and friends. See
82-
:ref:`sphx_glr_gallery_lines_bars_and_markers_psd_demo.py`.
82+
:doc:`/gallery/lines_bars_and_markers/psd_demo`.
8383
The changes should increase MATLAB
8484
compatibility and increase scaling options.
8585

doc/users/prev_whats_new/whats_new_0.99.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ New in matplotlib 0.99
1111
New documentation
1212
-----------------
1313

14-
Jae-Joon Lee has written two new guides :ref:`sphx_glr_tutorials_intermediate_legend_guide.py`
14+
Jae-Joon Lee has written two new guides :doc:`/tutorials/intermediate/legend_guide`
1515
and :ref:`plotting-guide-annotation`. Michael Sarahan has written
16-
:ref:`sphx_glr_tutorials_introductory_images.py`. John Hunter has written two new tutorials on
17-
working with paths and transformations: :ref:`sphx_glr_tutorials_advanced_path_tutorial.py` and
18-
:ref:`sphx_glr_tutorials_advanced_transforms_tutorial.py`.
16+
:doc:`/tutorials/introductory/images`. John Hunter has written two new tutorials on
17+
working with paths and transformations: :doc:`/tutorials/advanced/path_tutorial` and
18+
:doc:`/tutorials/advanced/transforms_tutorial`.
1919

2020
.. _whats-new-mplot3d:
2121

@@ -65,7 +65,7 @@ that denote the data limits -- in various arbitrary locations. No
6565
longer are your axis lines constrained to be a simple rectangle around
6666
the figure -- you can turn on or off left, bottom, right and top, as
6767
well as "detach" the spine to offset it away from the data. See
68-
:ref:`sphx_glr_gallery_ticks_and_spines_spine_placement_demo.py` and
68+
:doc:`/gallery/ticks_and_spines/spine_placement_demo` and
6969
:class:`matplotlib.spines.Spine`.
7070

7171
.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_spines_001.png

doc/users/prev_whats_new/whats_new_1.0.rst

+2-2
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 :ref:`sphx_glr_tutorials_intermediate_gridspec.py` for a tutorial overview.
26+
more. See :doc:`/tutorials/intermediate/gridspec` for a tutorial overview.
2727

2828
.. figure:: ../../gallery/userdemo/images/sphx_glr_demo_gridspec01_000.png
2929
:target: ../../gallery/userdemo/demo_gridspec01.html
@@ -44,7 +44,7 @@ indexing (starts with 0). e.g.::
4444
fig, axarr = plt.subplots(2, 2)
4545
axarr[0,0].plot([1,2,3]) # upper, left
4646

47-
See :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplot_demo.py` for several code examples.
47+
See :doc:`/gallery/subplots_axes_and_figures/subplot_demo` for several code examples.
4848

4949
Contour fixes and and triplot
5050
---------------------------------

doc/users/prev_whats_new/whats_new_1.1.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Sankey Diagrams
1717

1818
Kevin Davies has extended Yannick Copin's original Sankey example into a module
1919
(:mod:`~matplotlib.sankey`) and provided new examples
20-
(:ref:`sphx_glr_gallery_api_sankey_basics.py`, :ref:`sphx_glr_gallery_api_sankey_links.py`,
21-
:ref:`sphx_glr_gallery_api_sankey_rankine.py`).
20+
(:doc:`/gallery/api/sankey_basics`, :doc:`/gallery/api/sankey_links`,
21+
:doc:`/gallery/api/sankey_rankine`).
2222

2323
.. figure:: ../../gallery/api/images/sphx_glr_sankey_rankine_001.png
2424
:target: ../../gallery/api/sankey_rankine.html
@@ -87,7 +87,7 @@ The usage of this functionality can be as simple as ::
8787

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

9393
PyQT4, PySide, and IPython
@@ -116,7 +116,7 @@ legends for complex plots such as :meth:`~matplotlib.pyplot.stem` plots
116116
will now display correctly. Second, the 'best' placement of a legend has
117117
been improved in the presence of NANs.
118118

119-
See the :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for more detailed explanation and
119+
See the :doc:`/tutorials/intermediate/legend_guide` for more detailed explanation and
120120
examples.
121121

122122
.. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_legend_demo_004.png

doc/users/prev_whats_new/whats_new_1.2.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PGF/TikZ backend
3939
Peter Würtz wrote a backend that allows matplotlib to export figures as
4040
drawing commands for LaTeX. These can be processed by PdfLaTeX, XeLaTeX or
4141
LuaLaTeX using the PGF/TikZ package. Usage examples and documentation are
42-
found in :ref:`sphx_glr_tutorials_text_pgf.py`.
42+
found in :doc:`/tutorials/text/pgf`.
4343

4444
.. image:: /_static/pgf_preamble.*
4545

doc/users/prev_whats_new/whats_new_1.4.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ with :func:`~matplotlib.Axes.bxp`.
8282
Lastly, each artist (e.g., the box, outliers, cap, notches) can now be
8383
toggled on or off and their styles can be passed in through individual
8484
kwargs. See the examples:
85-
:ref:`sphx_glr_gallery_statistics_boxplot.py` and
86-
:ref:`sphx_glr_gallery_statistics_bxp.py`
85+
:doc:`/gallery/statistics/boxplot` and
86+
:doc:`/gallery/statistics/bxp`
8787

8888
Added a bool kwarg, :code:`manage_xticks`, which if False disables the management
8989
of the ticks and limits on the x-axis by :func:`~matplotlib.axes.Axes.bxp`.
@@ -410,7 +410,7 @@ instead of ``:context:`` any time you want to reset the context.
410410

411411
Legend and PathEffects documentation
412412
------------------------------------
413-
The :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` and :ref:`sphx_glr_tutorials_advanced_patheffects_guide.py` have both been
413+
The :doc:`/tutorials/intermediate/legend_guide` and :doc:`/tutorials/advanced/patheffects_guide` have both been
414414
updated to better reflect the full potential of each of these powerful
415415
features.
416416

doc/users/prev_whats_new/whats_new_1.5.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ mutually exclusive inside that group. For tools derived from
679679
that are called automatically whenever it is toggled.
680680

681681

682-
A full example is located in :ref:`sphx_glr_gallery_user_interfaces_toolmanager_sgskip.py`
682+
A full example is located in :doc:`/gallery/user_interfaces/toolmanager_sgskip`
683683

684684

685685
cbook.is_sequence_of_strings recognizes string objects

doc/users/prev_whats_new/whats_new_2.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Filled ``+`` and ``x`` markers
275275

276276
New fillable *plus* and *x* markers have been added. See
277277
the :mod:`~matplotlib.markers` module and
278-
:ref:`marker reference <sphx_glr_gallery_lines_bars_and_markers_marker_reference.py>`
278+
:doc:`marker reference </gallery/lines_bars_and_markers/marker_reference>`
279279
examples.
280280

281281
`rcount` and `ccount` for `plot_surface()`

doc/users/prev_whats_new/whats_new_2.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ PolygonSelector
139139

140140
A :class:`~matplotlib.widgets.PolygonSelector` class has been added to
141141
:mod:`matplotlib.widgets`. See
142-
:ref:`sphx_glr_gallery_widgets_polygon_selector_demo.py` for details.
142+
:doc:`/gallery/widgets/polygon_selector_demo` for details.
143143

144144

145145
Added `matplotlib.ticker.PercentFormatter`

doc/users/shell.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ are going to need to understand what a matplotlib backend is
9292
With the TkAgg backend, which uses the Tkinter user interface toolkit,
9393
you can use matplotlib from an arbitrary non-gui python shell. Just set your
9494
``backend : TkAgg`` and ``interactive : True`` in your
95-
:file:`matplotlibrc` file (see :ref:`sphx_glr_tutorials_introductory_customizing.py`) and fire
95+
:file:`matplotlibrc` file (see :doc:`/tutorials/introductory/customizing`) and fire
9696
up python. Then::
9797

9898
>>> from pylab import *

examples/axes_grid1/simple_anchored_artists.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This example illustrates the use of the anchored helper classes found in
77
:py:mod:`~matplotlib.offsetbox` and in the :ref:`toolkit_axesgrid1-index`.
88
An implementation of a similar figure, but without use of the toolkit,
9-
can be found in :ref:`sphx_glr_gallery_misc_anchored_artists.py`.
9+
can be found in :doc:`/gallery/misc/anchored_artists`.
1010
"""
1111

1212
import matplotlib.pyplot as plt

examples/color/color_cycle_default.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
====================================
55
66
Display the colors from the default prop_cycle, which is obtained from the
7-
:ref:`rc parameters<sphx_glr_tutorials_introductory_customizing.py>`.
7+
:ref:`rc parameters</tutorials/introductory/customizing>`.
88
"""
99
import numpy as np
1010
import matplotlib.pyplot as plt

examples/color/color_cycler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
This example demonstrates two different APIs:
1010
1111
1. Setting the default
12-
:ref:`rc parameter<sphx_glr_tutorials_introductory_customizing.py>`
12+
:doc:`rc parameter</tutorials/introductory/customizing>`
1313
specifying the property cycle. This affects all subsequent axes
1414
(but not axes already created).
1515
2. Setting the property cycle for a single pair of axes.

examples/color/color_demo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
2727
For more information on colors in matplotlib see
2828
29-
* the :ref:`sphx_glr_tutorials_colors_colors.py` tutorial;
29+
* the :doc:`/tutorials/colors/colors` tutorial;
3030
* the `matplotlib.colors` API;
31-
* the :ref:`sphx_glr_gallery_color_named_colors.py` example.
31+
* the :doc:`/gallery/color/named_colors` example.
3232
"""
3333

3434
import matplotlib.pyplot as plt

examples/color/named_colors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
88
For more information on colors in matplotlib see
99
10-
* the :ref:`sphx_glr_tutorials_colors_colors.py` tutorial;
10+
* the :doc:`/tutorials/colors/colors` tutorial;
1111
* the `matplotlib.colors` API;
12-
* the :ref:`sphx_glr_gallery_color_color_demo.py`.
12+
* the :doc:`/gallery/color/color_demo`.
1313
"""
1414

1515
import matplotlib.pyplot as plt

examples/images_contours_and_fields/contour_demo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
See also the
1010
:ref:`contour image example
11-
<sphx_glr_gallery_images_contours_and_fields_contour_image.py>`.
11+
</gallery/images_contours_and_fields/contour_image>`.
1212
"""
1313
import matplotlib
1414
import numpy as np

examples/images_contours_and_fields/contour_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
Test combinations of contouring, filled contouring, and image plotting.
77
For contour labelling, see See also the
88
:ref:`contour demo example
9-
<sphx_glr_gallery_images_contours_and_fields_contour_demo.py>`.
9+
</gallery/images_contours_and_fields/contour_demo>`.
1010
1111
The emphasis in this demo is on showing how to make contours register
1212
correctly on images, and on how to get both of them oriented as
1313
desired. In particular, note the usage of the
1414
:ref:`"origin" and "extent"
15-
<sphx_glr_tutorials_intermediate_imshow_extent.py>`
15+
</tutorials/intermediate/imshow_extent>`
1616
keyword arguments to imshow and contour.
1717
"""
1818
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)