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

Skip to content

Commit 0cf0eda

Browse files
authored
Merge pull request #15985 from anntzer/unmethylation
Remove unnecessary :func:, :meth: from examples markup.
2 parents ce7115d + b02ffa6 commit 0cf0eda

19 files changed

+51
-57
lines changed

examples/color/custom_cmap.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
For more detail on creating and manipulating colormaps see
77
:doc:`/tutorials/colors/colormap-manipulation`.
88
9-
Creating a :doc:`colormap </tutorials/colors/colormaps>`
10-
from a list of colors can be done with the
11-
:meth:`~.colors.LinearSegmentedColormap.from_list` method of
12-
`.LinearSegmentedColormap`. You must pass a list of RGB tuples that define the
13-
mixture of colors from 0 to 1.
9+
Creating a :doc:`colormap </tutorials/colors/colormaps>` from a list of colors
10+
can be done with the `.LinearSegmentedColormap.from_list` method. You must
11+
pass a list of RGB tuples that define the mixture of colors from 0 to 1.
1412
1513
1614
Creating custom colormaps

examples/images_contours_and_fields/contourf_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Contourf Demo
44
=============
55
6-
How to use the :meth:`.axes.Axes.contourf` method to create filled contour plots.
6+
How to use the `.axes.Axes.contourf` method to create filled contour plots.
77
"""
8+
89
import numpy as np
910
import matplotlib.pyplot as plt
1011

examples/images_contours_and_fields/image_annotated_heatmap.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
variables as a color coded image plot. This is often referred to as a
88
heatmap. If the data is categorical, this would be called a categorical
99
heatmap.
10-
Matplotlib's :meth:`imshow <matplotlib.axes.Axes.imshow>` function makes
10+
11+
Matplotlib's `~matplotlib.axes.Axes.imshow` function makes
1112
production of such plots particularly easy.
1213
1314
The following examples show how to create a heatmap with annotations.
@@ -25,11 +26,11 @@
2526
# which defines the data to color code. We then also need two lists or arrays
2627
# of categories; of course the number of elements in those lists
2728
# need to match the data along the respective axes.
28-
# The heatmap itself is an :meth:`imshow <matplotlib.axes.Axes.imshow>` plot
29+
# The heatmap itself is an `~matplotlib.axes.Axes.imshow` plot
2930
# with the labels set to the categories we have.
3031
# Note that it is important to set both, the tick locations
31-
# (:meth:`set_xticks<matplotlib.axes.Axes.set_xticks>`) as well as the
32-
# tick labels (:meth:`set_xticklabels<matplotlib.axes.Axes.set_xticklabels>`),
32+
# (`~matplotlib.axes.Axes.set_xticks`) as well as the
33+
# tick labels (`~matplotlib.axes.Axes.set_xticklabels`),
3334
# otherwise they would become out of sync. The locations are just
3435
# the ascending integer numbers, while the ticklabels are the labels to show.
3536
# Finally we can label the data itself by creating a `~matplotlib.text.Text`

examples/images_contours_and_fields/image_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Many ways to plot images in Matplotlib.
77
88
The most common way to plot images in Matplotlib is with
9-
:meth:`~.axes.Axes.imshow`. The following examples demonstrate much of the
9+
`~.axes.Axes.imshow`. The following examples demonstrate much of the
1010
functionality of imshow and the many images you can create.
1111
"""
1212

examples/images_contours_and_fields/image_transparency_blend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Blend transparency with color to highlight parts of data with imshow.
77
8-
A common use for :func:`matplotlib.pyplot.imshow` is to plot a 2-D statistical
8+
A common use for `matplotlib.pyplot.imshow` is to plot a 2-D statistical
99
map. The function makes it easy to visualize a 2-D matrix as an image and add
1010
transparency to the output. For example, one can plot a statistic (such as a
1111
t-statistic) and color the transparency of each pixel according to its p-value.
@@ -67,7 +67,7 @@ def normal_pdf(x, mean, var):
6767
# ========================
6868
#
6969
# The simplest way to include transparency when plotting data with
70-
# :func:`matplotlib.pyplot.imshow` is to pass an array matching the shape of
70+
# `matplotlib.pyplot.imshow` is to pass an array matching the shape of
7171
# the data to the ``alpha`` argument. For example, we'll create a gradient
7272
# moving from left to right below.
7373

examples/images_contours_and_fields/interpolation_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
=========================
55
66
This example displays the difference between interpolation methods for
7-
:meth:`~.axes.Axes.imshow`.
7+
`~.axes.Axes.imshow`.
88
99
If *interpolation* is None, it defaults to the :rc:`image.interpolation`.
1010
If the interpolation is ``'none'``, then no interpolation is performed for the

examples/images_contours_and_fields/pcolor_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Pcolor Demo
44
===========
55
6-
Generating images with :meth:`~.axes.Axes.pcolor`.
6+
Generating images with `~.axes.Axes.pcolor`.
77
88
Pcolor allows you to generate 2-D image-style plots. Below we will show how
99
to do so in Matplotlib.
@@ -33,9 +33,9 @@
3333
# Comparing pcolor with similar functions
3434
# ---------------------------------------
3535
#
36-
# Demonstrates similarities between :meth:`~.axes.Axes.pcolor`,
37-
# :meth:`~.axes.Axes.pcolormesh`, :meth:`~.axes.Axes.imshow` and
38-
# :meth:`~.axes.Axes.pcolorfast` for drawing quadrilateral grids.
36+
# Demonstrates similarities between `~.axes.Axes.pcolor`,
37+
# `~.axes.Axes.pcolormesh`, `~.axes.Axes.imshow` and
38+
# `~.axes.Axes.pcolorfast` for drawing quadrilateral grids.
3939

4040
# make these smaller to increase the resolution
4141
dx, dy = 0.15, 0.05

examples/images_contours_and_fields/pcolormesh_levels.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
pcolormesh
44
==========
55
6-
Shows how to combine Normalization and Colormap instances to draw
7-
"levels" in :meth:`~.axes.Axes.pcolor`, :meth:`~.axes.Axes.pcolormesh`
8-
and :meth:`~.axes.Axes.imshow` type plots in a similar
9-
way to the levels keyword argument to contour/contourf.
10-
6+
Shows how to combine Normalization and Colormap instances to draw "levels" in
7+
`~.axes.Axes.pcolor`, `~.axes.Axes.pcolormesh` and `~.axes.Axes.imshow` type
8+
plots in a similar way to the levels keyword argument to contour/contourf.
119
"""
1210

1311
import matplotlib

examples/images_contours_and_fields/plot_streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
==========
55
66
A stream plot, or streamline plot, is used to display 2D vector fields. This
7-
example shows a few features of the :meth:`~.axes.Axes.streamplot` function:
7+
example shows a few features of the `~.axes.Axes.streamplot` function:
88
99
* Varying the color along a streamline.
1010
* Varying the density of streamlines.

examples/lines_bars_and_markers/scatter_with_legend.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@
3737
# -------------------------
3838
#
3939
# Another option for creating a legend for a scatter is to use the
40-
# `~matplotlib.collections.PathCollection`'s
41-
# :meth:`~.PathCollection.legend_elements` method.
42-
# It will automatically try to determine a useful number of legend entries
43-
# to be shown and return a tuple of handles and labels. Those can be passed
44-
# to the call to :meth:`~.axes.Axes.legend`.
40+
# `.PathCollection.legend_elements` method. It will automatically try to
41+
# determine a useful number of legend entries to be shown and return a tuple of
42+
# handles and labels. Those can be passed to the call to `~.axes.Axes.legend`.
4543

4644

4745
N = 45
@@ -66,10 +64,9 @@
6664

6765

6866
##############################################################################
69-
# Further arguments to the :meth:`~.PathCollection.legend_elements` method
67+
# Further arguments to the `.PathCollection.legend_elements` method
7068
# can be used to steer how many legend entries are to be created and how they
7169
# should be labeled. The following shows how to use some of them.
72-
#
7370

7471
volume = np.random.rayleigh(27, size=40)
7572
amount = np.random.poisson(10, size=40)

examples/lines_bars_and_markers/span_regions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
Illustrate some helper functions for shading regions where a logical
77
mask is True.
88
9-
See :meth:`matplotlib.collections.BrokenBarHCollection.span_where`
9+
See `matplotlib.collections.BrokenBarHCollection.span_where`.
1010
"""
11+
1112
import numpy as np
1213
import matplotlib.pyplot as plt
1314
import matplotlib.collections as collections

examples/pie_and_polar_charts/nested_pie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
###############################################################################
1515
# The most straightforward way to build a pie chart is to use the
16-
# :meth:`pie method <matplotlib.axes.Axes.pie>`
16+
# `~matplotlib.axes.Axes.pie` method.
1717
#
1818
# In this case, pie takes values corresponding to counts in a group.
1919
# We'll first generate some fake data, corresponding to three groups.

examples/pie_and_polar_charts/pie_and_donut_labels.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Labeling a pie and a donut
44
==========================
55
6-
Welcome to the matplotlib bakery. We will create a pie and a donut
7-
chart through the :meth:`pie method <matplotlib.axes.Axes.pie>` and
8-
show how to label them with a :meth:`legend <matplotlib.axes.Axes.legend>`
9-
as well as with :meth:`annotations <matplotlib.axes.Axes.annotate>`.
6+
Welcome to the Matplotlib bakery. We will create a pie and a donut
7+
chart through the `pie method <matplotlib.axes.Axes.pie>` and
8+
show how to label them with a `legend <matplotlib.axes.Axes.legend>`
9+
as well as with `annotations <matplotlib.axes.Axes.annotate>`.
1010
"""
1111

1212
###############################################################################
@@ -71,7 +71,7 @@ def func(pct, allvals):
7171
# This is done via the ``wedgeprops`` argument.
7272
#
7373
# We then want to label the wedges via
74-
# :meth:`annotations <matplotlib.axes.Axes.annotate>`. We first create some
74+
# `annotations <matplotlib.axes.Axes.annotate>`. We first create some
7575
# dictionaries of common properties, which we can later pass as keyword
7676
# argument. We then iterate over all wedges and for each
7777
#

examples/pie_and_polar_charts/pie_demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Pie Demo2
44
=========
55
6-
Make a pie charts using :meth:`~.axes.Axes.pie`.
6+
Make a pie charts using `~.axes.Axes.pie`.
77
88
This example demonstrates some pie chart features like labels, varying size,
99
autolabeling the percentage, offsetting a slice and adding a shadow.

examples/recipes/create_subplots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
ax3 = fig.add_subplot(224, sharex=ax1, sharey=ax1)
2222

2323
###############################################################################
24-
# Fernando Perez has provided a nice top level method in
25-
# :func:`~matplotlib.pyplot.subplots` (note the "s" at the end) to create
24+
# Fernando Perez has provided the nice top-level function
25+
# `~matplotlib.pyplot.subplots` (note the "s" at the end) to create
2626
# everything at once, and turn on x and y sharing for the whole bunch.
2727
# You can either unpack the axes individually...
2828

examples/recipes/fill_between_alpha.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Fill Between and Alpha
33
======================
44
5-
The :meth:`~matplotlib.axes.Axes.fill_between` function generates a shaded
5+
The `~matplotlib.axes.Axes.fill_between` function generates a shaded
66
region between a min and max boundary that is useful for illustrating ranges.
77
It has a very handy ``where`` argument to combine filling with logical ranges,
88
e.g., to just fill in a curve over some threshold value.
@@ -125,10 +125,9 @@
125125
ax.grid()
126126

127127
###############################################################################
128-
# Another handy use of filled regions is to highlight horizontal or
129-
# vertical spans of an axes -- for that matplotlib has some helper
130-
# functions :meth:`~matplotlib.axes.Axes.axhspan` and
131-
# :meth:`~matplotlib.axes.Axes.axvspan` and example
128+
# Another handy use of filled regions is to highlight horizontal or vertical
129+
# spans of an axes -- for that Matplotlib has the helper functions
130+
# `~matplotlib.axes.Axes.axhspan` and `~matplotlib.axes.Axes.axvspan`. See
132131
# :doc:`/gallery/subplots_axes_and_figures/axhspan_demo`.
133132

134133
plt.show()

examples/recipes/share_axis_lims_views.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
Sharing axis limits and views
33
=============================
44
5-
It's common to make two or more plots which share an axis, e.g., two
6-
subplots with time as a common axis. When you pan and zoom around on
7-
one, you want the other to move around with you. To facilitate this,
8-
matplotlib Axes support a ``sharex`` and ``sharey`` attribute. When
9-
you create a :func:`~matplotlib.pyplot.subplot` or
10-
:func:`~matplotlib.pyplot.axes` instance, you can pass in a keyword
11-
indicating what axes you want to share with
5+
It's common to make two or more plots which share an axis, e.g., two subplots
6+
with time as a common axis. When you pan and zoom around on one, you want the
7+
other to move around with you. To facilitate this, matplotlib Axes support a
8+
``sharex`` and ``sharey`` attribute. When you create a `~.pyplot.subplot` or
9+
`~.pyplot.axes`, you can pass in a keyword indicating what axes you want to
10+
share with.
1211
"""
1312

1413
import numpy as np

examples/subplots_axes_and_figures/subplots_adjust.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
===============
55
66
Adjusting the spacing of margins and subplots using
7-
:func:`~matplotlib.pyplot.subplots_adjust`.
7+
`~matplotlib.pyplot.subplots_adjust`.
88
"""
9+
910
import matplotlib.pyplot as plt
1011
import numpy as np
1112

1213
# Fixing random state for reproducibility
1314
np.random.seed(19680801)
1415

15-
1616
plt.subplot(211)
1717
plt.imshow(np.random.random((100, 100)), cmap=plt.cm.BuPu_r)
1818
plt.subplot(212)

examples/subplots_axes_and_figures/two_scales.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
You can use separate `matplotlib.ticker` formatters and locators as
1010
desired since the two axes are independent.
1111
12-
Such axes are generated by calling the :meth:`.Axes.twinx` method. Likewise,
13-
:meth:`.Axes.twiny` is available to generate axes that share a *y* axis but
12+
Such axes are generated by calling the `.Axes.twinx` method. Likewise,
13+
`.Axes.twiny` is available to generate axes that share a *y* axis but
1414
have different top and bottom scales.
1515
"""
1616
import numpy as np

0 commit comments

Comments
 (0)