From bded7cb26596d506e838de6ba7872b11f68ebd53 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 25 May 2018 03:31:06 -0700 Subject: [PATCH 1/2] 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. --- doc/api/api_changes.rst | 4 ++-- doc/api/pyplot_summary.rst | 4 ++-- doc/api/toolkits/index.rst | 2 +- doc/api/toolkits/mplot3d/index.rst | 2 +- doc/devel/contributing.rst | 2 +- doc/faq/howto_faq.rst | 16 ++++++++-------- doc/faq/installing_faq.rst | 2 +- doc/faq/troubleshooting_faq.rst | 2 +- doc/users/dflt_style_changes.rst | 4 ++-- doc/users/prev_whats_new/whats_new_0.98.4.rst | 2 +- doc/users/prev_whats_new/whats_new_0.99.rst | 10 +++++----- doc/users/prev_whats_new/whats_new_1.0.rst | 4 ++-- doc/users/prev_whats_new/whats_new_1.1.rst | 8 ++++---- doc/users/prev_whats_new/whats_new_1.2.rst | 2 +- doc/users/prev_whats_new/whats_new_1.4.rst | 6 +++--- doc/users/prev_whats_new/whats_new_1.5.rst | 2 +- doc/users/prev_whats_new/whats_new_2.0.0.rst | 2 +- doc/users/prev_whats_new/whats_new_2.1.0.rst | 2 +- doc/users/shell.rst | 2 +- examples/axes_grid1/simple_anchored_artists.py | 2 +- examples/color/color_cycle_default.py | 2 +- examples/color/color_cycler.py | 2 +- examples/color/color_demo.py | 4 ++-- examples/color/named_colors.py | 4 ++-- .../images_contours_and_fields/contour_demo.py | 2 +- .../images_contours_and_fields/contour_image.py | 4 ++-- .../contour_label_demo.py | 2 +- .../images_contours_and_fields/custom_cmap.py | 2 +- .../images_contours_and_fields/image_demo.py | 4 ++-- .../interpolation_methods.py | 2 +- .../images_contours_and_fields/quiver_demo.py | 2 +- .../quiver_simple_demo.py | 2 +- .../line_demo_dash_control.py | 2 +- examples/misc/anchored_artists.py | 2 +- examples/recipes/fill_between_alpha.py | 2 +- examples/recipes/placing_text_boxes.py | 2 +- examples/shapes_and_collections/ellipse_demo.py | 2 +- .../subplots_axes_and_figures/subplot_demo.py | 2 +- .../custom_legends.py | 4 ++-- lib/matplotlib/axes/_axes.py | 8 ++++---- lib/matplotlib/figure.py | 2 +- lib/matplotlib/legend.py | 4 ++-- lib/matplotlib/legend_handler.py | 2 +- lib/matplotlib/mathtext.py | 2 +- lib/matplotlib/ticker.py | 2 +- lib/matplotlib/widgets.py | 4 ++-- tutorials/advanced/transforms_tutorial.py | 2 +- tutorials/intermediate/tight_layout_guide.py | 2 +- tutorials/introductory/lifecycle.py | 6 +++--- tutorials/introductory/pyplot.py | 16 ++++++++-------- tutorials/introductory/sample_plots.py | 2 +- tutorials/introductory/usage.py | 10 +++++----- tutorials/text/annotations.py | 4 ++-- tutorials/text/mathtext.py | 6 +++--- tutorials/text/text_props.py | 6 +++--- tutorials/text/usetex.py | 4 ++-- 56 files changed, 105 insertions(+), 105 deletions(-) diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 6a66a0bc3367..fa9ccddf786d 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -30,7 +30,7 @@ New dependency `kiwisolver `__ is now a required dependency to support the new constrained_layout, see -:ref:`sphx_glr_tutorials_intermediate_constrainedlayout_guide.py` for +:doc:`/tutorials/intermediate/constrainedlayout_guide` for more details. @@ -1603,7 +1603,7 @@ original location: * The legend handler interface has changed from a callable, to any object which implements the ``legend_artists`` method (a deprecation phase will see this interface be maintained for v1.4). See - :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for further details. Further legend changes + :doc:`/tutorials/intermediate/legend_guide` for further details. Further legend changes include: * :func:`matplotlib.axes.Axes._get_legend_handles` now returns a generator diff --git a/doc/api/pyplot_summary.rst b/doc/api/pyplot_summary.rst index db513d8c2660..4b290d5452af 100644 --- a/doc/api/pyplot_summary.rst +++ b/doc/api/pyplot_summary.rst @@ -8,7 +8,7 @@ The Pyplot API The :mod:`matplotlib.pyplot` module contains functions that allow you to generate many kinds of plots quickly. For examples that showcase the use of the :mod:`matplotlib.pyplot` module, see the -:ref:`sphx_glr_tutorials_introductory_pyplot.py` +:doc:`/tutorials/introductory/pyplot` or the :ref:`pyplots_examples`. We also recommend that you look into the object-oriented approach to plotting, described below. @@ -38,6 +38,6 @@ There are many colormaps you can use to map data onto color values. Below we list several ways in which color can be utilized in Matplotlib. For a more in-depth look at colormaps, see the -:ref:`sphx_glr_tutorials_colors_colormaps.py` tutorial. +:doc:`/tutorials/colors/colormaps` tutorial. .. autofunction:: colormaps diff --git a/doc/api/toolkits/index.rst b/doc/api/toolkits/index.rst index f995dfb3b54d..2089156a1d21 100644 --- a/doc/api/toolkits/index.rst +++ b/doc/api/toolkits/index.rst @@ -21,7 +21,7 @@ mplot3d plotting (scatter, surf, line, mesh) tools. Not the fastest or most feature complete 3D library out there, but it ships with Matplotlib and thus may be a lighter weight solution for some use cases. Check out the -:ref:`mplot3d tutorial ` for more +:doc:`mplot3d tutorial ` for more information. .. figure:: ../../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png diff --git a/doc/api/toolkits/mplot3d/index.rst b/doc/api/toolkits/mplot3d/index.rst index b5ec1418deec..8b153c06903f 100644 --- a/doc/api/toolkits/mplot3d/index.rst +++ b/doc/api/toolkits/mplot3d/index.rst @@ -11,7 +11,7 @@ The mplot3d toolkit adds simple 3D plotting capabilities to matplotlib by supplying an axes object that can create a 2D projection of a 3D scene. The resulting graph will have the same look and feel as regular 2D plots. -See the :ref:`mplot3d tutorial ` for +See the :doc:`mplot3d tutorial ` for more information on how to use this toolkit. .. image:: /_static/demo_mplot3d.png diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index 3821297366f1..9063529e0e57 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -479,7 +479,7 @@ Developing a new backend ------------------------ If you are working on a custom backend, the *backend* setting in -:file:`matplotlibrc` (:ref:`sphx_glr_tutorials_introductory_customizing.py`) supports an +:file:`matplotlibrc` (:doc:`/tutorials/introductory/customizing`) supports an external backend via the ``module`` directive. If :file:`my_backend.py` is a Matplotlib backend in your :envvar:`PYTHONPATH`, you can set it on one of several ways diff --git a/doc/faq/howto_faq.rst b/doc/faq/howto_faq.rst index 09fc7d8c1007..83cff0830b39 100644 --- a/doc/faq/howto_faq.rst +++ b/doc/faq/howto_faq.rst @@ -43,7 +43,7 @@ If you only want to use the `pandas` converter for `datetime64` values :: Find all objects in a figure of a certain type ---------------------------------------------- -Every Matplotlib artist (see :ref:`sphx_glr_tutorials_intermediate_artists.py`) has a method +Every Matplotlib artist (see :doc:`/tutorials/intermediate/artists`) has a method called :meth:`~matplotlib.artist.Artist.findobj` that can be used to recursively search the artist for any artists it may contain that meet some criteria (e.g., match all :class:`~matplotlib.lines.Line2D` @@ -159,7 +159,7 @@ labels:: ax = fig.add_subplot(111) You can control the defaults for these parameters in your -:file:`matplotlibrc` file; see :ref:`sphx_glr_tutorials_introductory_customizing.py`. For +:file:`matplotlibrc` file; see :doc:`/tutorials/introductory/customizing`. For example, to make the above setting permanent, you would set:: figure.subplot.bottom : 0.2 # the bottom of the subplots of the figure @@ -190,7 +190,7 @@ specify the location explicitly:: ax = fig.add_axes([left, bottom, width, height]) where all values are in fractional (0 to 1) coordinates. See -:ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_demo.py` for an example of placing axes manually. +:doc:`/gallery/subplots_axes_and_figures/axes_demo` for an example of placing axes manually. .. _howto-auto-adjust: @@ -200,7 +200,7 @@ Automatically make room for tick labels .. note:: This is now easier to handle than ever before. Calling :func:`~matplotlib.pyplot.tight_layout` can fix many common - layout issues. See the :ref:`sphx_glr_tutorials_intermediate_tight_layout_guide.py`. + layout issues. See the :doc:`/tutorials/intermediate/tight_layout_guide`. The information below is kept here in case it is useful for other purposes. @@ -352,7 +352,7 @@ and patches, respectively:: .. only:: html - See :ref:`sphx_glr_gallery_misc_zorder_demo.py` for a complete example. + See :doc:`/gallery/misc/zorder_demo` for a complete example. You can also use the Axes property :meth:`~matplotlib.axes.Axes.set_axisbelow` to control whether the grid @@ -371,7 +371,7 @@ some ratio which controls the ratio:: .. only:: html - See :ref:`sphx_glr_gallery_subplots_axes_and_figures_axis_equal_demo.py` for a + See :doc:`/gallery/subplots_axes_and_figures/axis_equal_demo` for a complete example. .. _howto-twoscale: @@ -415,7 +415,7 @@ locators as desired because the two axes are independent. .. only:: html - See :ref:`sphx_glr_gallery_api_two_scales.py` for a complete example + See :doc:`/gallery/api/two_scales` for a complete example .. _howto-batch: @@ -661,7 +661,7 @@ For more on configuring your backend, see Alternatively, you can avoid pylab/pyplot altogether, which will give you a little more control, by calling the API directly as shown in -:ref:`sphx_glr_gallery_api_agg_oo_sgskip.py`. +:doc:`/gallery/api/agg_oo_sgskip`. You can either generate hardcopy on the filesystem by calling savefig:: diff --git a/doc/faq/installing_faq.rst b/doc/faq/installing_faq.rst index ddff518df5aa..6aa37b8ed0d2 100644 --- a/doc/faq/installing_faq.rst +++ b/doc/faq/installing_faq.rst @@ -26,7 +26,7 @@ example:: This will give you additional information about which backends matplotlib is loading, version information, and more. At this point you might want to make -sure you understand matplotlib's :ref:`configuration ` +sure you understand matplotlib's :doc:`configuration ` process, governed by the :file:`matplotlibrc` configuration file which contains instructions within and the concept of the matplotlib backend. diff --git a/doc/faq/troubleshooting_faq.rst b/doc/faq/troubleshooting_faq.rst index 3ceb9a578468..7002156948e2 100644 --- a/doc/faq/troubleshooting_faq.rst +++ b/doc/faq/troubleshooting_faq.rst @@ -104,7 +104,7 @@ provide the following information in your e-mail to the `mailing list `Enthought Canopy `_). * Any customizations to your ``matplotlibrc`` file (see - :ref:`sphx_glr_tutorials_introductory_customizing.py`). + :doc:`/tutorials/introductory/customizing`). * If the problem is reproducible, please try to provide a *minimal*, standalone Python script that demonstrates the problem. This is *the* critical step. diff --git a/doc/users/dflt_style_changes.rst b/doc/users/dflt_style_changes.rst index f2a7badf6f2c..22624683892b 100644 --- a/doc/users/dflt_style_changes.rst +++ b/doc/users/dflt_style_changes.rst @@ -96,7 +96,7 @@ 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 -:ref:`sphx_glr_tutorials_colors_colors.py` for more details. +:doc:`/tutorials/colors/colors` for more details. To restore the old color cycle use @@ -145,7 +145,7 @@ watch Nathaniel Smith and Stéfan van der Walt's talk from SciPy2015. See `here for many more details `__ about the other alternatives and the tools used to create the color map. For details on all of the color maps available in matplotlib see -:ref:`sphx_glr_tutorials_colors_colormaps.py`. +:doc:`/tutorials/colors/colormaps`. .. raw:: html diff --git a/doc/users/prev_whats_new/whats_new_0.98.4.rst b/doc/users/prev_whats_new/whats_new_0.98.4.rst index c10f15743f0e..a7339d6027f6 100644 --- a/doc/users/prev_whats_new/whats_new_0.98.4.rst +++ b/doc/users/prev_whats_new/whats_new_0.98.4.rst @@ -79,7 +79,7 @@ psd amplitude scaling Ryan May did a lot of work to rationalize the amplitude scaling of :func:`~matplotlib.pyplot.psd` and friends. See -:ref:`sphx_glr_gallery_lines_bars_and_markers_psd_demo.py`. +:doc:`/gallery/lines_bars_and_markers/psd_demo`. The changes should increase MATLAB compatibility and increase scaling options. diff --git a/doc/users/prev_whats_new/whats_new_0.99.rst b/doc/users/prev_whats_new/whats_new_0.99.rst index 8ae2055a751e..2ffebe153eb6 100644 --- a/doc/users/prev_whats_new/whats_new_0.99.rst +++ b/doc/users/prev_whats_new/whats_new_0.99.rst @@ -11,11 +11,11 @@ New in matplotlib 0.99 New documentation ----------------- -Jae-Joon Lee has written two new guides :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` +Jae-Joon Lee has written two new guides :doc:`/tutorials/intermediate/legend_guide` and :ref:`plotting-guide-annotation`. Michael Sarahan has written -:ref:`sphx_glr_tutorials_introductory_images.py`. John Hunter has written two new tutorials on -working with paths and transformations: :ref:`sphx_glr_tutorials_advanced_path_tutorial.py` and -:ref:`sphx_glr_tutorials_advanced_transforms_tutorial.py`. +:doc:`/tutorials/introductory/images`. John Hunter has written two new tutorials on +working with paths and transformations: :doc:`/tutorials/advanced/path_tutorial` and +:doc:`/tutorials/advanced/transforms_tutorial`. .. _whats-new-mplot3d: @@ -65,7 +65,7 @@ that denote the data limits -- in various arbitrary locations. No longer are your axis lines constrained to be a simple rectangle around the figure -- you can turn on or off left, bottom, right and top, as well as "detach" the spine to offset it away from the data. See -:ref:`sphx_glr_gallery_ticks_and_spines_spine_placement_demo.py` and +:doc:`/gallery/ticks_and_spines/spine_placement_demo` and :class:`matplotlib.spines.Spine`. .. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_spines_001.png diff --git a/doc/users/prev_whats_new/whats_new_1.0.rst b/doc/users/prev_whats_new/whats_new_1.0.rst index 3675c528aa7d..5d7403c91b1b 100644 --- a/doc/users/prev_whats_new/whats_new_1.0.rst +++ b/doc/users/prev_whats_new/whats_new_1.0.rst @@ -23,7 +23,7 @@ Sophisticated subplot grid layout Jae-Joon Lee has written :mod:`~matplotlib.gridspec`, a new module for doing complex subplot layouts, featuring row and column spans and -more. See :ref:`sphx_glr_tutorials_intermediate_gridspec.py` for a tutorial overview. +more. See :doc:`/tutorials/intermediate/gridspec` for a tutorial overview. .. figure:: ../../gallery/userdemo/images/sphx_glr_demo_gridspec01_000.png :target: ../../gallery/userdemo/demo_gridspec01.html @@ -44,7 +44,7 @@ indexing (starts with 0). e.g.:: fig, axarr = plt.subplots(2, 2) axarr[0,0].plot([1,2,3]) # upper, left -See :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplot_demo.py` for several code examples. +See :doc:`/gallery/subplots_axes_and_figures/subplot_demo` for several code examples. Contour fixes and and triplot --------------------------------- diff --git a/doc/users/prev_whats_new/whats_new_1.1.rst b/doc/users/prev_whats_new/whats_new_1.1.rst index 80c0aaea240b..cf9d38dd234a 100644 --- a/doc/users/prev_whats_new/whats_new_1.1.rst +++ b/doc/users/prev_whats_new/whats_new_1.1.rst @@ -17,8 +17,8 @@ Sankey Diagrams Kevin Davies has extended Yannick Copin's original Sankey example into a module (:mod:`~matplotlib.sankey`) and provided new examples -(:ref:`sphx_glr_gallery_api_sankey_basics.py`, :ref:`sphx_glr_gallery_api_sankey_links.py`, -:ref:`sphx_glr_gallery_api_sankey_rankine.py`). +(:doc:`/gallery/api/sankey_basics`, :doc:`/gallery/api/sankey_links`, +:doc:`/gallery/api/sankey_rankine`). .. figure:: ../../gallery/api/images/sphx_glr_sankey_rankine_001.png :target: ../../gallery/api/sankey_rankine.html @@ -87,7 +87,7 @@ The usage of this functionality can be as simple as :: and it will adjust the spacing between subplots so that the axis labels do not overlap with neighboring subplots. A -:ref:`sphx_glr_tutorials_intermediate_tight_layout_guide.py` has been created to show how to use +:doc:`/tutorials/intermediate/tight_layout_guide` has been created to show how to use this new tool. PyQT4, PySide, and IPython @@ -116,7 +116,7 @@ legends for complex plots such as :meth:`~matplotlib.pyplot.stem` plots will now display correctly. Second, the 'best' placement of a legend has been improved in the presence of NANs. -See the :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for more detailed explanation and +See the :doc:`/tutorials/intermediate/legend_guide` for more detailed explanation and examples. .. figure:: ../../gallery/text_labels_and_annotations/images/sphx_glr_legend_demo_004.png diff --git a/doc/users/prev_whats_new/whats_new_1.2.rst b/doc/users/prev_whats_new/whats_new_1.2.rst index 495d674a3e00..01104c1b55a1 100644 --- a/doc/users/prev_whats_new/whats_new_1.2.rst +++ b/doc/users/prev_whats_new/whats_new_1.2.rst @@ -39,7 +39,7 @@ PGF/TikZ backend Peter Würtz wrote a backend that allows matplotlib to export figures as drawing commands for LaTeX. These can be processed by PdfLaTeX, XeLaTeX or LuaLaTeX using the PGF/TikZ package. Usage examples and documentation are -found in :ref:`sphx_glr_tutorials_text_pgf.py`. +found in :doc:`/tutorials/text/pgf`. .. image:: /_static/pgf_preamble.* diff --git a/doc/users/prev_whats_new/whats_new_1.4.rst b/doc/users/prev_whats_new/whats_new_1.4.rst index ffbd1701754b..48dbd8266e22 100644 --- a/doc/users/prev_whats_new/whats_new_1.4.rst +++ b/doc/users/prev_whats_new/whats_new_1.4.rst @@ -82,8 +82,8 @@ with :func:`~matplotlib.Axes.bxp`. Lastly, each artist (e.g., the box, outliers, cap, notches) can now be toggled on or off and their styles can be passed in through individual kwargs. See the examples: -:ref:`sphx_glr_gallery_statistics_boxplot.py` and -:ref:`sphx_glr_gallery_statistics_bxp.py` +:doc:`/gallery/statistics/boxplot` and +:doc:`/gallery/statistics/bxp` Added a bool kwarg, :code:`manage_xticks`, which if False disables the management 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. Legend and PathEffects documentation ------------------------------------ -The :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` and :ref:`sphx_glr_tutorials_advanced_patheffects_guide.py` have both been +The :doc:`/tutorials/intermediate/legend_guide` and :doc:`/tutorials/advanced/patheffects_guide` have both been updated to better reflect the full potential of each of these powerful features. diff --git a/doc/users/prev_whats_new/whats_new_1.5.rst b/doc/users/prev_whats_new/whats_new_1.5.rst index 19610709498f..854cb889f746 100644 --- a/doc/users/prev_whats_new/whats_new_1.5.rst +++ b/doc/users/prev_whats_new/whats_new_1.5.rst @@ -679,7 +679,7 @@ mutually exclusive inside that group. For tools derived from that are called automatically whenever it is toggled. -A full example is located in :ref:`sphx_glr_gallery_user_interfaces_toolmanager_sgskip.py` +A full example is located in :doc:`/gallery/user_interfaces/toolmanager_sgskip` cbook.is_sequence_of_strings recognizes string objects diff --git a/doc/users/prev_whats_new/whats_new_2.0.0.rst b/doc/users/prev_whats_new/whats_new_2.0.0.rst index 809b3ac4da25..b16a3d97dc3d 100644 --- a/doc/users/prev_whats_new/whats_new_2.0.0.rst +++ b/doc/users/prev_whats_new/whats_new_2.0.0.rst @@ -275,7 +275,7 @@ Filled ``+`` and ``x`` markers New fillable *plus* and *x* markers have been added. See the :mod:`~matplotlib.markers` module and -:ref:`marker reference ` +:doc:`marker reference ` examples. `rcount` and `ccount` for `plot_surface()` diff --git a/doc/users/prev_whats_new/whats_new_2.1.0.rst b/doc/users/prev_whats_new/whats_new_2.1.0.rst index 51e42ea2d875..20231c0332f0 100644 --- a/doc/users/prev_whats_new/whats_new_2.1.0.rst +++ b/doc/users/prev_whats_new/whats_new_2.1.0.rst @@ -139,7 +139,7 @@ PolygonSelector A :class:`~matplotlib.widgets.PolygonSelector` class has been added to :mod:`matplotlib.widgets`. See -:ref:`sphx_glr_gallery_widgets_polygon_selector_demo.py` for details. +:doc:`/gallery/widgets/polygon_selector_demo` for details. Added `matplotlib.ticker.PercentFormatter` diff --git a/doc/users/shell.rst b/doc/users/shell.rst index 63e214c6ae67..09b1d9c1558f 100644 --- a/doc/users/shell.rst +++ b/doc/users/shell.rst @@ -92,7 +92,7 @@ are going to need to understand what a matplotlib backend is With the TkAgg backend, which uses the Tkinter user interface toolkit, you can use matplotlib from an arbitrary non-gui python shell. Just set your ``backend : TkAgg`` and ``interactive : True`` in your -:file:`matplotlibrc` file (see :ref:`sphx_glr_tutorials_introductory_customizing.py`) and fire +:file:`matplotlibrc` file (see :doc:`/tutorials/introductory/customizing`) and fire up python. Then:: >>> from pylab import * diff --git a/examples/axes_grid1/simple_anchored_artists.py b/examples/axes_grid1/simple_anchored_artists.py index 479dae594f6e..9a8ae92335e9 100644 --- a/examples/axes_grid1/simple_anchored_artists.py +++ b/examples/axes_grid1/simple_anchored_artists.py @@ -6,7 +6,7 @@ This example illustrates the use of the anchored helper classes found in :py:mod:`~matplotlib.offsetbox` and in the :ref:`toolkit_axesgrid1-index`. An implementation of a similar figure, but without use of the toolkit, -can be found in :ref:`sphx_glr_gallery_misc_anchored_artists.py`. +can be found in :doc:`/gallery/misc/anchored_artists`. """ import matplotlib.pyplot as plt diff --git a/examples/color/color_cycle_default.py b/examples/color/color_cycle_default.py index d4f70a0d90df..e84a55751d83 100644 --- a/examples/color/color_cycle_default.py +++ b/examples/color/color_cycle_default.py @@ -4,7 +4,7 @@ ==================================== Display the colors from the default prop_cycle, which is obtained from the -:ref:`rc parameters`. +:ref:`rc parameters`. """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/color/color_cycler.py b/examples/color/color_cycler.py index bab0cb163559..e1ba72c4090a 100644 --- a/examples/color/color_cycler.py +++ b/examples/color/color_cycler.py @@ -9,7 +9,7 @@ This example demonstrates two different APIs: 1. Setting the default - :ref:`rc parameter` + :doc:`rc parameter` specifying the property cycle. This affects all subsequent axes (but not axes already created). 2. Setting the property cycle for a single pair of axes. diff --git a/examples/color/color_demo.py b/examples/color/color_demo.py index 9740744f3cfe..d366f0a1b959 100644 --- a/examples/color/color_demo.py +++ b/examples/color/color_demo.py @@ -26,9 +26,9 @@ For more information on colors in matplotlib see -* the :ref:`sphx_glr_tutorials_colors_colors.py` tutorial; +* the :doc:`/tutorials/colors/colors` tutorial; * the `matplotlib.colors` API; -* the :ref:`sphx_glr_gallery_color_named_colors.py` example. +* the :doc:`/gallery/color/named_colors` example. """ import matplotlib.pyplot as plt diff --git a/examples/color/named_colors.py b/examples/color/named_colors.py index ea9b08c61318..80ea924eb425 100644 --- a/examples/color/named_colors.py +++ b/examples/color/named_colors.py @@ -7,9 +7,9 @@ For more information on colors in matplotlib see -* the :ref:`sphx_glr_tutorials_colors_colors.py` tutorial; +* the :doc:`/tutorials/colors/colors` tutorial; * the `matplotlib.colors` API; -* the :ref:`sphx_glr_gallery_color_color_demo.py`. +* the :doc:`/gallery/color/color_demo`. """ import matplotlib.pyplot as plt diff --git a/examples/images_contours_and_fields/contour_demo.py b/examples/images_contours_and_fields/contour_demo.py index 2724d29164b1..f6d2a5f617ce 100644 --- a/examples/images_contours_and_fields/contour_demo.py +++ b/examples/images_contours_and_fields/contour_demo.py @@ -8,7 +8,7 @@ See also the :ref:`contour image example -`. +`. """ import matplotlib import numpy as np diff --git a/examples/images_contours_and_fields/contour_image.py b/examples/images_contours_and_fields/contour_image.py index 9bfe4d9fe546..7df8996bf7d2 100644 --- a/examples/images_contours_and_fields/contour_image.py +++ b/examples/images_contours_and_fields/contour_image.py @@ -6,13 +6,13 @@ Test combinations of contouring, filled contouring, and image plotting. For contour labelling, see See also the :ref:`contour demo example -`. +`. The emphasis in this demo is on showing how to make contours register correctly on images, and on how to get both of them oriented as desired. In particular, note the usage of the :ref:`"origin" and "extent" -` +` keyword arguments to imshow and contour. """ import matplotlib.pyplot as plt diff --git a/examples/images_contours_and_fields/contour_label_demo.py b/examples/images_contours_and_fields/contour_label_demo.py index b3c2c75cb801..5aeacac67797 100644 --- a/examples/images_contours_and_fields/contour_label_demo.py +++ b/examples/images_contours_and_fields/contour_label_demo.py @@ -7,7 +7,7 @@ contour labels. See also the :ref:`contour demo example -`. +`. """ import matplotlib diff --git a/examples/images_contours_and_fields/custom_cmap.py b/examples/images_contours_and_fields/custom_cmap.py index 4b2b98ce137f..f01a4e8a8e64 100644 --- a/examples/images_contours_and_fields/custom_cmap.py +++ b/examples/images_contours_and_fields/custom_cmap.py @@ -3,7 +3,7 @@ Creating a colormap from a list of colors ========================================= -Creating a :ref:`colormap ` +Creating a :doc:`colormap ` from a list of colors can be done with the :meth:`~.colors.LinearSegmentedColormap.from_list` method of `LinearSegmentedColormap`. You must pass a list of RGB tuples that define the diff --git a/examples/images_contours_and_fields/image_demo.py b/examples/images_contours_and_fields/image_demo.py index c7d0cdf5b154..2cd09dc88f9a 100644 --- a/examples/images_contours_and_fields/image_demo.py +++ b/examples/images_contours_and_fields/image_demo.py @@ -114,7 +114,7 @@ # This allows you to plot the full range of your array w/o edge effects, # and for example to layer multiple images of different sizes over one # another with different interpolation methods - see -# :ref:`sphx_glr_gallery_images_contours_and_fields_layer_images.py`. +# :doc:`/gallery/images_contours_and_fields/layer_images`. # It also implies a performance hit, as this # new temporary, padded array must be created. Sophisticated # interpolation also implies a performance hit, so if you need maximal @@ -138,7 +138,7 @@ # You can also control the default setting image.origin in your # :ref:`matplotlibrc file `. For more on # this topic see the :ref:`complete guide on origin and extent -# `. +# `. x = np.arange(120).reshape((10, 12)) diff --git a/examples/images_contours_and_fields/interpolation_methods.py b/examples/images_contours_and_fields/interpolation_methods.py index 3e90986237b6..08efa9f5d5df 100644 --- a/examples/images_contours_and_fields/interpolation_methods.py +++ b/examples/images_contours_and_fields/interpolation_methods.py @@ -7,7 +7,7 @@ :meth:`~.axes.Axes.imshow` and :meth:`~.axes.Axes.matshow`. If `interpolation` is None, it defaults to the ``image.interpolation`` -:ref:`rc parameter `. +:doc:`rc parameter `. If the interpolation is ``'none'``, then no interpolation is performed for the Agg, ps and pdf backends. Other backends will default to ``'nearest'``. diff --git a/examples/images_contours_and_fields/quiver_demo.py b/examples/images_contours_and_fields/quiver_demo.py index 281a9854d130..89711ba65117 100644 --- a/examples/images_contours_and_fields/quiver_demo.py +++ b/examples/images_contours_and_fields/quiver_demo.py @@ -5,7 +5,7 @@ Demonstrates some more advanced options for `~.axes.Axes.quiver`. For a simple example refer to -:ref:`sphx_glr_gallery_images_contours_and_fields_quiver_simple_demo.py`. +:doc:`/gallery/images_contours_and_fields/quiver_simple_demo`. Known problem: the plot autoscaling does not take into account the arrows, so those on the boundaries are often out of the picture. diff --git a/examples/images_contours_and_fields/quiver_simple_demo.py b/examples/images_contours_and_fields/quiver_simple_demo.py index 39349abac095..abaf5279eb5d 100644 --- a/examples/images_contours_and_fields/quiver_simple_demo.py +++ b/examples/images_contours_and_fields/quiver_simple_demo.py @@ -7,7 +7,7 @@ `~.axes.Axes.quiverkey`. For more advanced options refer to -:ref:`sphx_glr_gallery_images_contours_and_fields_quiver_demo.py`. +:doc:`/gallery/images_contours_and_fields/quiver_demo`. """ import matplotlib.pyplot as plt import numpy as np diff --git a/examples/lines_bars_and_markers/line_demo_dash_control.py b/examples/lines_bars_and_markers/line_demo_dash_control.py index af4411daf0c9..78043dfed2ff 100644 --- a/examples/lines_bars_and_markers/line_demo_dash_control.py +++ b/examples/lines_bars_and_markers/line_demo_dash_control.py @@ -14,7 +14,7 @@ line. *Note*: The dash style can also be configured via a -:ref:`property_cycle ` +:doc:`property_cycle ` by passing a list of dash sequences using the keyword *dashes* to the cycler. This is not shown within this example. """ diff --git a/examples/misc/anchored_artists.py b/examples/misc/anchored_artists.py index 42ec13d0e03e..cd829f80fb25 100644 --- a/examples/misc/anchored_artists.py +++ b/examples/misc/anchored_artists.py @@ -6,7 +6,7 @@ This example illustrates the use of the anchored objects without the helper classes found in the :ref:`toolkit_axesgrid1-index`. This version of the figure is similar to the one found in -:ref:`sphx_glr_gallery_axes_grid1_simple_anchored_artists.py`, but it is +:doc:`/gallery/axes_grid1/simple_anchored_artists`, but it is implemented using only the matplotlib namespace, without the help of additional toolkits. """ diff --git a/examples/recipes/fill_between_alpha.py b/examples/recipes/fill_between_alpha.py index 3a53841b33d7..ec004af3b031 100644 --- a/examples/recipes/fill_between_alpha.py +++ b/examples/recipes/fill_between_alpha.py @@ -133,6 +133,6 @@ # vertical spans of an axes -- for that matplotlib has some helper # functions :meth:`~matplotlib.axes.Axes.axhspan` and # :meth:`~matplotlib.axes.Axes.axvspan` and example -# :ref:`sphx_glr_gallery_subplots_axes_and_figures_axhspan_demo.py`. +# :doc:`/gallery/subplots_axes_and_figures/axhspan_demo`. plt.show() diff --git a/examples/recipes/placing_text_boxes.py b/examples/recipes/placing_text_boxes.py index 882839c502b7..51a6c143742f 100644 --- a/examples/recipes/placing_text_boxes.py +++ b/examples/recipes/placing_text_boxes.py @@ -3,7 +3,7 @@ ================== When decorating axes with text boxes, two useful tricks are to place -the text in axes coordinates (see :ref:`sphx_glr_tutorials_advanced_transforms_tutorial.py`), so the +the text in axes coordinates (see :doc:`/tutorials/advanced/transforms_tutorial`), so the text doesn't move around with changes in x or y limits. You can also use the ``bbox`` property of text to surround the text with a :class:`~matplotlib.patches.Patch` instance -- the ``bbox`` keyword diff --git a/examples/shapes_and_collections/ellipse_demo.py b/examples/shapes_and_collections/ellipse_demo.py index 21fbe7d9c0e5..10c28e872b1d 100644 --- a/examples/shapes_and_collections/ellipse_demo.py +++ b/examples/shapes_and_collections/ellipse_demo.py @@ -5,7 +5,7 @@ Draw many ellipses. Here individual ellipses are drawn. Compare this to the :ref:`Ellipse collection example -`. +`. """ import matplotlib.pyplot as plt import numpy as np diff --git a/examples/subplots_axes_and_figures/subplot_demo.py b/examples/subplots_axes_and_figures/subplot_demo.py index 828184dde624..836476829a65 100644 --- a/examples/subplots_axes_and_figures/subplot_demo.py +++ b/examples/subplots_axes_and_figures/subplot_demo.py @@ -5,7 +5,7 @@ Demo with two subplots. For more options, see -:ref:`sphx_glr_gallery_subplots_axes_and_figures_subplots_demo.py` +:doc:`/gallery/subplots_axes_and_figures/subplots_demo` """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/text_labels_and_annotations/custom_legends.py b/examples/text_labels_and_annotations/custom_legends.py index 81e3795ddab9..f37cd2ab61fd 100644 --- a/examples/text_labels_and_annotations/custom_legends.py +++ b/examples/text_labels_and_annotations/custom_legends.py @@ -10,8 +10,8 @@ For more information on creating and customizing legends, see the following pages: - * :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` - * :ref:`sphx_glr_gallery_text_labels_and_annotations_legend_demo.py` + * :doc:`/tutorials/intermediate/legend_guide` + * :doc:`/gallery/text_labels_and_annotations/legend_demo` Sometimes you don't want a legend that is explicitly tied to data that you have plotted. For example, say you have plotted 10 lines, but don't diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index edc67865a6bb..c05db4f3aa5f 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -363,7 +363,7 @@ def legend(self, *args, **kwargs): ----- Not all kinds of artist are supported by the legend command. See - :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for details. + :doc:`/tutorials/intermediate/legend_guide` for details. Examples -------- @@ -1879,7 +1879,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center", upper errors. - *None*: No errorbar. (Default) - See :ref:`sphx_glr_gallery_statistics_errorbar_features.py` + See :doc:`/gallery/statistics/errorbar_features` for an example on the usage of ``xerr`` and ``yerr``. ecolor : scalar or array-like, optional, default: 'black' @@ -2158,7 +2158,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center", upper errors. - *None*: No errorbar. (default) - See :ref:`sphx_glr_gallery_statistics_errorbar_features.py` + See :doc:`/gallery/statistics/errorbar_features` for an example on the usage of ``xerr`` and ``yerr``. ecolor : scalar or array-like, optional, default: 'black' @@ -2687,7 +2687,7 @@ def errorbar(self, x, y, yerr=None, xerr=None, upper errors. - *None*: No errorbar. - See :ref:`sphx_glr_gallery_statistics_errorbar_features.py` + See :doc:`/gallery/statistics/errorbar_features` for an example on the usage of ``xerr`` and ``yerr``. fmt : plot format string, optional, default: '' diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index c6cd6ce44794..e898f9082acd 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1557,7 +1557,7 @@ def legend(self, *args, **kwargs): Notes ----- Not all kinds of artist are supported by the legend command. See - :ref:`sphx_glr_tutorials_intermediate_legend_guide.py` for details. + :doc:`/tutorials/intermediate/legend_guide` for details. """ handles, labels, extra_args, kwargs = mlegend._parse_legend_args( diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index a516eaf43f64..03fb4683e9a0 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -8,7 +8,7 @@ Most users would normally create a legend via the :meth:`~matplotlib.axes.Axes.legend` function. For more details on legends there is also a :ref:`legend guide - `. + `. The Legend class can be considered as a container of legend handles and legend texts. Creation of corresponding legend handles from the @@ -19,7 +19,7 @@ Note that not all kinds of artist are supported by the legend yet by default but it is possible to extend the legend handler's capabilities to support arbitrary objects. See the :ref:`legend guide -` for more information. +` for more information. """ diff --git a/lib/matplotlib/legend_handler.py b/lib/matplotlib/legend_handler.py index 84405f2cbbc4..86e695a02726 100644 --- a/lib/matplotlib/legend_handler.py +++ b/lib/matplotlib/legend_handler.py @@ -2,7 +2,7 @@ This module defines default legend handlers. It is strongly encouraged to have read the :ref:`legend guide -` before this documentation. +` before this documentation. Legend handlers are expected to be a callable object with a following signature. :: diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 7614a78f0f3e..1d4328b44b9d 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2,7 +2,7 @@ :mod:`~matplotlib.mathtext` is a module for parsing a subset of the TeX math syntax and drawing them to a matplotlib backend. -For a tutorial of its usage see :ref:`sphx_glr_tutorials_text_mathtext.py`. This +For a tutorial of its usage see :doc:`/tutorials/text/mathtext`. This document is primarily concerned with implementation details. The module uses pyparsing_ to parse the TeX expression. diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 60658a144be2..acce04792666 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -159,7 +159,7 @@ ax.yaxis.set_major_formatter(ymajor_formatter) ax.yaxis.set_minor_formatter(yminor_formatter) -See :ref:`sphx_glr_gallery_ticks_and_spines_major_minor_demo.py` for an +See :doc:`/gallery/ticks_and_spines/major_minor_demo` for an example of setting major and minor ticks. See the :mod:`matplotlib.dates` module for more information and examples of using date locators and formatters. """ diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 9c16cb228601..e3442b230d1b 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1724,7 +1724,7 @@ class SpanSelector(_SelectorWidget): rectprops=rectprops) >>> fig.show() - See also: :ref:`sphx_glr_gallery_widgets_span_selector.py` + See also: :doc:`/gallery/widgets/span_selector` """ @@ -2576,7 +2576,7 @@ class PolygonSelector(_SelectorWidget): See Also -------- - :ref:`sphx_glr_gallery_widgets_polygon_selector_demo.py` + :doc:`/gallery/widgets/polygon_selector_demo` """ def __init__(self, ax, onselect, useblit=False, diff --git a/tutorials/advanced/transforms_tutorial.py b/tutorials/advanced/transforms_tutorial.py index 439d1898b2fe..e80c12b77b1b 100644 --- a/tutorials/advanced/transforms_tutorial.py +++ b/tutorials/advanced/transforms_tutorial.py @@ -467,4 +467,4 @@ # see how to make your own, since Matplotlib supports extensible axes # and projections. Michael Droettboom has provided a nice tutorial # example of creating a Hammer projection axes; see -# :ref:`sphx_glr_gallery_misc_custom_projection.py`. +# :doc:`/gallery/misc/custom_projection`. diff --git a/tutorials/intermediate/tight_layout_guide.py b/tutorials/intermediate/tight_layout_guide.py index 6318032e6412..04d7a045fc2f 100644 --- a/tutorials/intermediate/tight_layout_guide.py +++ b/tutorials/intermediate/tight_layout_guide.py @@ -115,7 +115,7 @@ def example_plot(ax, fontsize=12): ############################################################################### # It works with subplots created with # :func:`~matplotlib.pyplot.subplot2grid`. In general, subplots created -# from the gridspec (:ref:`sphx_glr_tutorials_intermediate_gridspec.py`) will work. +# from the gridspec (:doc:`/tutorials/intermediate/gridspec`) will work. plt.close('all') fig = plt.figure() diff --git a/tutorials/introductory/lifecycle.py b/tutorials/introductory/lifecycle.py index 68770cf9efe0..c6bb681e8976 100644 --- a/tutorials/introductory/lifecycle.py +++ b/tutorials/introductory/lifecycle.py @@ -26,7 +26,7 @@ The second is based on MATLAB and uses a state-based interface. This is encapsulated in the :mod:`pyplot` module. See the :ref:`pyplot tutorials -` +` for a more in-depth look at the pyplot interface. Most of the terms are straightforward but the main thing to remember @@ -86,7 +86,7 @@ # # Figures can have multiple axes on them. For information on how to do this, # see the :ref:`Tight Layout tutorial -# `. +# `. fig, ax = plt.subplots() @@ -149,7 +149,7 @@ # that we create. To do this we'll set the ``autolayout`` value of our # rcParams. For more information on controlling the style, layout, and # other features of plots with rcParams, see -# :ref:`sphx_glr_tutorials_introductory_customizing.py`. +# :doc:`/tutorials/introductory/customizing`. plt.rcParams.update({'figure.autolayout': True}) diff --git a/tutorials/introductory/pyplot.py b/tutorials/introductory/pyplot.py index 6d52145d2970..bcb58bdf63a1 100644 --- a/tutorials/introductory/pyplot.py +++ b/tutorials/introductory/pyplot.py @@ -277,8 +277,8 @@ def f(t): # rectangular grid, use the :func:`~matplotlib.pyplot.axes` command, # which allows you to specify the location as ``axes([left, bottom, # width, height])`` where all values are in fractional (0 to 1) -# coordinates. See :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_demo.py` for an example of -# placing axes manually and :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplot_demo.py` for an +# coordinates. See :doc:`/gallery/subplots_axes_and_figures/axes_demo` for an example of +# placing axes manually and :doc:`/gallery/subplots_axes_and_figures/subplot_demo` for an # example with lots of subplots. # # @@ -307,7 +307,7 @@ def f(t): # it annoying that states (specifically the current image, figure and axes) # are being maintained for you behind the scenes, don't despair: this is just a thin # stateful wrapper around an object oriented API, which you can use -# instead (see :ref:`sphx_glr_tutorials_intermediate_artists.py`) +# instead (see :doc:`/tutorials/intermediate/artists`) # # If you are making lots of figures, you need to be aware of one # more thing: the memory required for a figure is not completely @@ -326,7 +326,7 @@ def f(t): # The :func:`~matplotlib.pyplot.text` command can be used to add text in # an arbitrary location, and the :func:`~matplotlib.pyplot.xlabel`, # :func:`~matplotlib.pyplot.ylabel` and :func:`~matplotlib.pyplot.title` -# are used to add text in the indicated locations (see :ref:`sphx_glr_tutorials_text_text_intro.py` +# are used to add text in the indicated locations (see :doc:`/tutorials/text/text_intro` # for a more detailed example) mu, sigma = 100, 15 @@ -352,7 +352,7 @@ def f(t): # # t = plt.xlabel('my data', fontsize=14, color='red') # -# These properties are covered in more detail in :ref:`sphx_glr_tutorials_text_text_props.py`. +# These properties are covered in more detail in :doc:`/tutorials/text/text_props`. # # # Using mathematical expressions in text @@ -368,11 +368,11 @@ def f(t): # that the string is a *raw* string and not to treat backslashes as # python escapes. matplotlib has a built-in TeX expression parser and # layout engine, and ships its own math fonts -- for details see -# :ref:`sphx_glr_tutorials_text_mathtext.py`. Thus you can use mathematical text across platforms +# :doc:`/tutorials/text/mathtext`. Thus you can use mathematical text across platforms # without requiring a TeX installation. For those who have LaTeX and # dvipng installed, you can also use LaTeX to format your text and # incorporate the output directly into your display figures or saved -# postscript -- see :ref:`sphx_glr_tutorials_text_usetex.py`. +# postscript -- see :doc:`/tutorials/text/usetex`. # # # Annotating text @@ -406,7 +406,7 @@ def f(t): # variety of other coordinate systems one can choose -- see # :ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` for # details. More examples can be found in -# :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_demo.py`. +# :doc:`/gallery/text_labels_and_annotations/annotation_demo`. # # # Logarithmic and other nonlinear axes diff --git a/tutorials/introductory/sample_plots.py b/tutorials/introductory/sample_plots.py index 8ea18696015e..97ad1a96948f 100644 --- a/tutorials/introductory/sample_plots.py +++ b/tutorials/introductory/sample_plots.py @@ -362,7 +362,7 @@ Matplotlib's mathtext infrastructure is an independent implementation and does not require TeX or any external packages installed on your computer. See -the tutorial at :ref:`sphx_glr_tutorials_text_mathtext.py`. +the tutorial at :doc:`/tutorials/text/mathtext`. .. _screenshots_tex_demo: diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 1fde15fbf392..c1f9a9f0ce7a 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -319,7 +319,7 @@ def my_plotter(ax, data1, data2, param_dict): # # # #. The ``backend`` parameter in your ``matplotlibrc`` file (see -# :ref:`sphx_glr_tutorials_introductory_customizing.py`):: +# :doc:`/tutorials/introductory/customizing`):: # # backend : WXAgg # use wxpython with antigrain (agg) rendering # @@ -507,7 +507,7 @@ def my_plotter(ax, data1, data2, param_dict): # that are called, and on a state variable that determines whether # matplotlib is in "interactive mode". The default Boolean value is set # by the :file:`matplotlibrc` file, and may be customized like any other -# configuration parameter (see :ref:`sphx_glr_tutorials_introductory_customizing.py`). It +# configuration parameter (see :doc:`/tutorials/introductory/customizing`). It # may also be set via :func:`matplotlib.interactive`, and its # value may be queried via :func:`matplotlib.is_interactive`. Turning # interactive mode on and off in the middle of a stream of plotting @@ -653,7 +653,7 @@ def my_plotter(ax, data1, data2, param_dict): # controlled by the ``path.simplify`` and # ``path.simplify_threshold`` parameters in your # ``matplotlibrc`` file (see -# :ref:`sphx_glr_tutorials_introductory_customizing.py` for +# :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 @@ -690,7 +690,7 @@ def my_plotter(ax, data1, data2, param_dict): # interactive plotting (with maximal simplification) and another # style for publication quality plotting (with minimal # simplification) and activate them as necessary. See -# :ref:`sphx_glr_tutorials_introductory_customizing.py` for +# :doc:`/tutorials/introductory/customizing` for # instructions on how to perform these actions. # # The simplification works by iteratively merging line segments @@ -721,7 +721,7 @@ def my_plotter(ax, data1, data2, param_dict): # # The markevery argument allows for naive subsampling, or an # attempt at evenly spaced (along the *x* axis) sampling. See the -# :ref:`sphx_glr_gallery_lines_bars_and_markers_markevery_demo.py` +# :doc:`/gallery/lines_bars_and_markers/markevery_demo` # for more information. # # Splitting lines into smaller chunks diff --git a/tutorials/text/annotations.py b/tutorials/text/annotations.py index 69d586cdf847..43f26648b2f8 100644 --- a/tutorials/text/annotations.py +++ b/tutorials/text/annotations.py @@ -94,7 +94,7 @@ For more on all the wild and wonderful things you can do with annotations, including fancy arrows, see :ref:`plotting-guide-annotation` -and :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_demo.py`. +and :doc:`/gallery/text_labels_and_annotations/annotation_demo`. Do not proceed unless you have already read :ref:`annotations-tutorial`, @@ -514,7 +514,7 @@ Annotation with Simple Coordinates 3 You may take a look at this example - :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_demo.py`. + :doc:`/gallery/text_labels_and_annotations/annotation_demo`. Using ConnectionPatch --------------------- diff --git a/tutorials/text/mathtext.py b/tutorials/text/mathtext.py index e99df50c559f..0cdc9d3062c4 100644 --- a/tutorials/text/mathtext.py +++ b/tutorials/text/mathtext.py @@ -12,7 +12,7 @@ layout engine is a fairly direct adaptation of the layout algorithms in Donald Knuth's TeX, so the quality is quite good (matplotlib also provides a ``usetex`` option for those who do want to call out to TeX -to generate their text (see :ref:`sphx_glr_tutorials_text_usetex.py`). +to generate their text (see :doc:`/tutorials/text/usetex`). """ ############################################################################### @@ -23,7 +23,7 @@ # (from (La)TeX), `STIX `_ fonts (with are designed # to blend well with Times), or a Unicode font that you provide. The mathtext # font can be selected with the customization variable ``mathtext.fontset`` (see -# :ref:`sphx_glr_tutorials_introductory_customizing.py`) +# :doc:`/tutorials/introductory/customizing`) # # .. note:: # On `"narrow" `_ builds @@ -64,7 +64,7 @@ # have special meaning outside of math mode in TeX. Therefore, these # characters will behave differently depending on the rcParam # ``text.usetex`` flag. See the :ref:`usetex tutorial -# ` for more information. +# ` for more information. # # Subscripts and superscripts # --------------------------- diff --git a/tutorials/text/text_props.py b/tutorials/text/text_props.py index a6adc42491b8..2555cefc53e8 100644 --- a/tutorials/text/text_props.py +++ b/tutorials/text/text_props.py @@ -14,12 +14,12 @@ Property Value Type ========================== ====================================================================================================================== alpha `float` -backgroundcolor any matplotlib :ref:`color ` +backgroundcolor any matplotlib :doc:`color ` bbox `~matplotlib.patches.Rectangle` prop dict plus key ``'pad'`` which is a pad in points clip_box a matplotlib.transform.Bbox instance clip_on bool clip_path a `~matplotlib.path.Path` instance and a `~matplotlib.transforms.Transform` instance, a `~matplotlib.patches.Patch` -color any matplotlib :ref:`color ` +color any matplotlib :doc:`color ` family [ ``'serif'`` | ``'sans-serif'`` | ``'cursive'`` | ``'fantasy'`` | ``'monospace'`` ] fontproperties a `~matplotlib.font_manager.FontProperties` instance horizontalalignment or ha [ ``'center'`` | ``'right'`` | ``'left'`` ] @@ -218,7 +218,7 @@ # # To control the font used on per-artist basis use the ``'name'``, # ``'fontname'`` or ``'fontproperties'`` kwargs documented :ref:`above -# `. +# `. # # # On linux, `fc-list `__ can be a diff --git a/tutorials/text/usetex.py b/tutorials/text/usetex.py index 00d7b8bf21e6..796ffa74694c 100644 --- a/tutorials/text/usetex.py +++ b/tutorials/text/usetex.py @@ -15,7 +15,7 @@ The LaTeX option is activated by setting ``text.usetex : True`` in your rc settings. Text handling with matplotlib's LaTeX support is slower than matplotlib's very capable :ref:`mathtext -`, but is more flexible, since different LaTeX +`, but is more flexible, since different LaTeX packages (font packages, math packages, etc.) can be used. The results can be striking, especially when you take care to use the same fonts in your figures as in the main document. @@ -26,7 +26,7 @@ external dependencies must all be located on your :envvar:`PATH`. There are a couple of options to mention, which can be changed using :ref:`rc -settings `. Here is an example matplotlibrc file:: +settings `. Here is an example matplotlibrc file:: font.family : serif font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman From 844b28cdd41ef2d6a72e4c768b592a26b06132a2 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 27 May 2018 03:36:50 -0700 Subject: [PATCH 2/2] Some manual fixes. --- examples/color/color_cycle_default.py | 2 +- examples/color/color_cycler.py | 9 +++--- .../contour_demo.py | 3 +- .../contour_image.py | 12 ++++---- .../contour_label_demo.py | 2 +- .../images_contours_and_fields/image_demo.py | 2 +- .../images_contours_and_fields/quiver_demo.py | 13 ++++---- .../quiver_simple_demo.py | 5 ++-- .../shapes_and_collections/ellipse_demo.py | 2 +- lib/matplotlib/legend.py | 30 +++++++++---------- lib/matplotlib/legend_handler.py | 2 +- lib/matplotlib/widgets.py | 2 +- tutorials/introductory/lifecycle.py | 11 ++++--- tutorials/text/mathtext.py | 2 +- tutorials/text/text_props.py | 2 +- tutorials/text/usetex.py | 18 +++++------ 16 files changed, 54 insertions(+), 63 deletions(-) diff --git a/examples/color/color_cycle_default.py b/examples/color/color_cycle_default.py index e84a55751d83..8de0048b54a9 100644 --- a/examples/color/color_cycle_default.py +++ b/examples/color/color_cycle_default.py @@ -4,7 +4,7 @@ ==================================== Display the colors from the default prop_cycle, which is obtained from the -:ref:`rc parameters`. +:doc:`rc parameters`. """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/color/color_cycler.py b/examples/color/color_cycler.py index e1ba72c4090a..57a69400426f 100644 --- a/examples/color/color_cycler.py +++ b/examples/color/color_cycler.py @@ -8,11 +8,10 @@ This example demonstrates two different APIs: - 1. Setting the default - :doc:`rc parameter` - specifying the property cycle. This affects all subsequent axes - (but not axes already created). - 2. Setting the property cycle for a single pair of axes. +1. Setting the default :doc:`rc parameter` + specifying the property cycle. This affects all subsequent axes (but not + axes already created). +2. Setting the property cycle for a single pair of axes. """ from cycler import cycler import numpy as np diff --git a/examples/images_contours_and_fields/contour_demo.py b/examples/images_contours_and_fields/contour_demo.py index f6d2a5f617ce..bfbffe41eb45 100644 --- a/examples/images_contours_and_fields/contour_demo.py +++ b/examples/images_contours_and_fields/contour_demo.py @@ -6,8 +6,7 @@ Illustrate simple contour plotting, contours on an image with a colorbar for the contours, and labelled contours. -See also the -:ref:`contour image example +See also the :doc:`contour image example `. """ import matplotlib diff --git a/examples/images_contours_and_fields/contour_image.py b/examples/images_contours_and_fields/contour_image.py index 7df8996bf7d2..df2cc7c381f1 100644 --- a/examples/images_contours_and_fields/contour_image.py +++ b/examples/images_contours_and_fields/contour_image.py @@ -4,16 +4,14 @@ ============= Test combinations of contouring, filled contouring, and image plotting. -For contour labelling, see See also the -:ref:`contour demo example +For contour labelling, see also the :doc:`contour demo example `. The emphasis in this demo is on showing how to make contours register -correctly on images, and on how to get both of them oriented as -desired. In particular, note the usage of the -:ref:`"origin" and "extent" -` -keyword arguments to imshow and contour. +correctly on images, and on how to get both of them oriented as desired. +In particular, note the usage of the :doc:`"origin" and "extent" +` keyword arguments to imshow and +contour. """ import matplotlib.pyplot as plt import numpy as np diff --git a/examples/images_contours_and_fields/contour_label_demo.py b/examples/images_contours_and_fields/contour_label_demo.py index 5aeacac67797..af26ab997c87 100644 --- a/examples/images_contours_and_fields/contour_label_demo.py +++ b/examples/images_contours_and_fields/contour_label_demo.py @@ -6,7 +6,7 @@ Illustrate some of the more advanced things that one can do with contour labels. -See also the :ref:`contour demo example +See also the :doc:`contour demo example `. """ diff --git a/examples/images_contours_and_fields/image_demo.py b/examples/images_contours_and_fields/image_demo.py index 2cd09dc88f9a..6ccb196b97d0 100644 --- a/examples/images_contours_and_fields/image_demo.py +++ b/examples/images_contours_and_fields/image_demo.py @@ -137,7 +137,7 @@ # x[0,0] in the upper left or lower right by using the origin parameter. # You can also control the default setting image.origin in your # :ref:`matplotlibrc file `. For more on -# this topic see the :ref:`complete guide on origin and extent +# this topic see the :doc:`complete guide on origin and extent # `. x = np.arange(120).reshape((10, 12)) diff --git a/examples/images_contours_and_fields/quiver_demo.py b/examples/images_contours_and_fields/quiver_demo.py index 89711ba65117..7c1711710076 100644 --- a/examples/images_contours_and_fields/quiver_demo.py +++ b/examples/images_contours_and_fields/quiver_demo.py @@ -3,14 +3,13 @@ Demonstration of advanced quiver and quiverkey functions ======================================================== -Demonstrates some more advanced options for `~.axes.Axes.quiver`. -For a simple example refer to -:doc:`/gallery/images_contours_and_fields/quiver_simple_demo`. +Demonstrates some more advanced options for `~.axes.Axes.quiver`. For a simple +example refer to :doc:`/gallery/images_contours_and_fields/quiver_simple_demo`. -Known problem: the plot autoscaling does not take into account -the arrows, so those on the boundaries are often out of the picture. -This is *not* an easy problem to solve in a perfectly general way. -The workaround is to manually expand the Axes objects. +Known problem: the plot autoscaling does not take into account the arrows, so +those on the boundaries are often out of the picture. This is *not* an easy +problem to solve in a perfectly general way. The workaround is to manually +expand the Axes objects. """ import matplotlib.pyplot as plt import numpy as np diff --git a/examples/images_contours_and_fields/quiver_simple_demo.py b/examples/images_contours_and_fields/quiver_simple_demo.py index abaf5279eb5d..61d5e8ff5f63 100644 --- a/examples/images_contours_and_fields/quiver_simple_demo.py +++ b/examples/images_contours_and_fields/quiver_simple_demo.py @@ -3,10 +3,9 @@ Quiver Simple Demo ================== -A simple example of a `~.axes.Axes.quiver` plot with a -`~.axes.Axes.quiverkey`. +A simple example of a `~.axes.Axes.quiver` plot with a `~.axes.Axes.quiverkey`. -For more advanced options refer to +For more advanced options refer to :doc:`/gallery/images_contours_and_fields/quiver_demo`. """ import matplotlib.pyplot as plt diff --git a/examples/shapes_and_collections/ellipse_demo.py b/examples/shapes_and_collections/ellipse_demo.py index 10c28e872b1d..29d8c2694b8b 100644 --- a/examples/shapes_and_collections/ellipse_demo.py +++ b/examples/shapes_and_collections/ellipse_demo.py @@ -4,7 +4,7 @@ ============ Draw many ellipses. Here individual ellipses are drawn. Compare this -to the :ref:`Ellipse collection example +to the :doc:`Ellipse collection example `. """ import matplotlib.pyplot as plt diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 03fb4683e9a0..5d2a50035360 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -4,23 +4,21 @@ .. important:: - It is unlikely that you would ever create a Legend instance manually. - Most users would normally create a legend via the + It is unlikely that you would ever create a Legend instance + manually. Most users would normally create a legend via the :meth:`~matplotlib.axes.Axes.legend` function. For more details on legends - there is also a :ref:`legend guide - `. - -The Legend class can be considered as a container of legend handles -and legend texts. Creation of corresponding legend handles from the -plot elements in the axes or figures (e.g., lines, patches, etc.) are -specified by the handler map, which defines the mapping between the -plot elements and the legend handlers to be used (the default legend -handlers are defined in the :mod:`~matplotlib.legend_handler` module). -Note that not all kinds of artist are supported by the legend yet by default -but it is possible to extend the legend handler's capabilities to support -arbitrary objects. See the :ref:`legend guide -` for more information. - + there is also a :doc:`legend guide `. + +The Legend class can be considered as a container of legend handles and +legend texts. Creation of corresponding legend handles from the plot elements +in the axes or figures (e.g., lines, patches, etc.) are specified by the +handler map, which defines the mapping between the plot elements and the +legend handlers to be used (the default legend handlers are defined in the +:mod:`~matplotlib.legend_handler` module). Note that not all kinds of +artist are supported by the legend yet by default but it is possible to +extend the legend handler's capabilities to support arbitrary objects. See +the :doc:`legend guide ` for more +information. """ import logging diff --git a/lib/matplotlib/legend_handler.py b/lib/matplotlib/legend_handler.py index 86e695a02726..ad574dcf33d0 100644 --- a/lib/matplotlib/legend_handler.py +++ b/lib/matplotlib/legend_handler.py @@ -1,7 +1,7 @@ """ This module defines default legend handlers. -It is strongly encouraged to have read the :ref:`legend guide +It is strongly encouraged to have read the :doc:`legend guide ` before this documentation. Legend handlers are expected to be a callable object with a following diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index e3442b230d1b..72ed42237b03 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2574,7 +2574,7 @@ class PolygonSelector(_SelectorWidget): if the mouse click is within `vertex_select_radius` pixels of the vertex. The default radius is 15 pixels. - See Also + Examples -------- :doc:`/gallery/widgets/polygon_selector_demo` """ diff --git a/tutorials/introductory/lifecycle.py b/tutorials/introductory/lifecycle.py index c6bb681e8976..c8af6d5c6183 100644 --- a/tutorials/introductory/lifecycle.py +++ b/tutorials/introductory/lifecycle.py @@ -23,11 +23,10 @@ interface. In this case, we utilize an instance of :class:`axes.Axes` in order to render visualizations on an instance of :class:`figure.Figure`. -The second is based on MATLAB and uses -a state-based interface. This is encapsulated in the :mod:`pyplot` -module. See the :ref:`pyplot tutorials -` -for a more in-depth look at the pyplot interface. +The second is based on MATLAB and uses a state-based interface. This is +encapsulated in the :mod:`pyplot` module. See the :doc:`pyplot tutorials +` for a more in-depth look at the pyplot +interface. Most of the terms are straightforward but the main thing to remember is that: @@ -85,7 +84,7 @@ # .. note:: # # Figures can have multiple axes on them. For information on how to do this, -# see the :ref:`Tight Layout tutorial +# see the :doc:`Tight Layout tutorial # `. fig, ax = plt.subplots() diff --git a/tutorials/text/mathtext.py b/tutorials/text/mathtext.py index 0cdc9d3062c4..9fafdcf1ed64 100644 --- a/tutorials/text/mathtext.py +++ b/tutorials/text/mathtext.py @@ -63,7 +63,7 @@ # # have special meaning outside of math mode in TeX. Therefore, these # characters will behave differently depending on the rcParam -# ``text.usetex`` flag. See the :ref:`usetex tutorial +# ``text.usetex`` flag. See the :doc:`usetex tutorial # ` for more information. # # Subscripts and superscripts diff --git a/tutorials/text/text_props.py b/tutorials/text/text_props.py index 2555cefc53e8..27567507db30 100644 --- a/tutorials/text/text_props.py +++ b/tutorials/text/text_props.py @@ -217,7 +217,7 @@ # font.sans-serif: Source Han Sans TW, Arial, sans-serif # # To control the font used on per-artist basis use the ``'name'``, -# ``'fontname'`` or ``'fontproperties'`` kwargs documented :ref:`above +# ``'fontname'`` or ``'fontproperties'`` kwargs documented :doc:`above # `. # # diff --git a/tutorials/text/usetex.py b/tutorials/text/usetex.py index 796ffa74694c..c0abd48aaad4 100644 --- a/tutorials/text/usetex.py +++ b/tutorials/text/usetex.py @@ -12,21 +12,21 @@ * PS * PDF -The LaTeX option is activated by setting ``text.usetex : True`` in -your rc settings. Text handling with matplotlib's LaTeX support is -slower than matplotlib's very capable :ref:`mathtext -`, but is more flexible, since different LaTeX -packages (font packages, math packages, etc.) can be used. The -results can be striking, especially when you take care to use the same -fonts in your figures as in the main document. +The LaTeX option is activated by setting ``text.usetex : True`` in your rc +settings. Text handling with matplotlib's LaTeX support is slower than +matplotlib's very capable :doc:`mathtext `, but is +more flexible, since different LaTeX packages (font packages, math packages, +etc.) can be used. The results can be striking, especially when you take care +to use the same fonts in your figures as in the main document. Matplotlib's LaTeX support requires a working LaTeX_ installation, dvipng_ (which may be included with your LaTeX installation), and Ghostscript_ (GPL Ghostscript 8.60 or later is recommended). The executables for these external dependencies must all be located on your :envvar:`PATH`. -There are a couple of options to mention, which can be changed using :ref:`rc -settings `. Here is an example matplotlibrc file:: +There are a couple of options to mention, which can be changed using +:doc:`rc settings `. Here is an example +matplotlibrc file:: font.family : serif font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman