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

Skip to content

Commit 6deab26

Browse files
authored
Merge pull request #15945 from timhoffm/doc-obj
Do not use "object" or "instance" when documenting types
2 parents 9d00ca8 + 9b6c7ad commit 6deab26

20 files changed

+32
-34
lines changed

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def get_tightbbox(self, renderer):
266266
267267
Parameters
268268
----------
269-
renderer : `.RendererBase` instance
269+
renderer : `.RendererBase` subclass
270270
renderer that will be used to draw the figures (i.e.
271271
``fig.canvas.get_renderer()``)
272272

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7485,7 +7485,7 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
74857485
The times corresponding to midpoints of segments (i.e., the columns
74867486
in *spectrum*).
74877487
7488-
im : instance of class `.AxesImage`
7488+
im : `.AxesImage`
74897489
The image created by imshow containing the spectrogram.
74907490
74917491
See Also

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4309,7 +4309,7 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
43094309
43104310
Parameters
43114311
----------
4312-
renderer : `.RendererBase` instance
4312+
renderer : `.RendererBase` subclass
43134313
renderer that will be used to draw the figures (i.e.
43144314
``fig.canvas.get_renderer()``)
43154315

lib/matplotlib/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ def __init__(self, norm=None, cmap=None):
159159
160160
Parameters
161161
----------
162-
norm : :class:`matplotlib.colors.Normalize` instance
162+
norm : `matplotlib.colors.Normalize` (or subclass thereof)
163163
The normalizing object which scales data, typically into the
164164
interval ``[0, 1]``.
165165
If *None*, *norm* defaults to a *colors.Normalize* object which
166166
initializes its scaling based on the first data processed.
167-
cmap : str or :class:`~matplotlib.colors.Colormap` instance
167+
cmap : str or `~matplotlib.colors.Colormap`
168168
The colormap used to map normalized data values to RGBA colors.
169169
"""
170170

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ def __init__(self,
14701470
"""
14711471
Parameters
14721472
----------
1473-
positions : 1D array-like object
1473+
positions : 1D array-like
14741474
Each value is an event.
14751475
14761476
orientation : {None, 'horizontal', 'vertical'}, optional

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@
161161
162162
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
163163
164-
cax : :class:`~matplotlib.axes.Axes` object, optional
164+
cax : `~matplotlib.axes.Axes`, optional
165165
Axes into which the colorbar will be drawn.
166166
167-
ax : :class:`~matplotlib.axes.Axes`, list of Axes, optional
167+
ax : `~matplotlib.axes.Axes`, list of Axes, optional
168168
Parent axes from which space for a new colorbar axes will be stolen.
169169
If a list of axes is given they will all be resized to make room for the
170170
colorbar axes.

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
17471747
data : array-like
17481748
A 2d array (or equivalent) of the height values used to generate a
17491749
shaded map.
1750-
cmap : `~matplotlib.colors.Colormap` instance
1750+
cmap : `~matplotlib.colors.Colormap`
17511751
The colormap used to color the *data* array. Note that this must be
17521752
a `~matplotlib.colors.Colormap` instance. For example, rather than
17531753
passing in `cmap='gist_earth'`, use

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def datestr2num(d, default=None):
382382
d : str or sequence of str
383383
The dates to convert.
384384
385-
default : datetime instance, optional
385+
default : datetime.datetime, optional
386386
The default date to use when fields are missing in *d*.
387387
"""
388388
if isinstance(d, str):

lib/matplotlib/figure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
14541454
14551455
Returns
14561456
-------
1457-
ax : `~.axes.Axes` object or array of Axes objects.
1457+
ax : `~.axes.Axes` or array of Axes
14581458
*ax* can be either a single `~matplotlib.axes.Axes` object or
14591459
an array of Axes objects if more than one subplot was created. The
14601460
dimensions of the resulting array can be controlled with the
@@ -1792,7 +1792,7 @@ def legend(self, *args, **kwargs):
17921792
17931793
Returns
17941794
-------
1795-
:class:`matplotlib.legend.Legend` instance
1795+
`~matplotlib.legend.Legend`
17961796
17971797
Notes
17981798
-----
@@ -2356,7 +2356,7 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
23562356
23572357
Parameters
23582358
----------
2359-
renderer : `.RendererBase` instance
2359+
renderer : `.RendererBase` subclass
23602360
renderer that will be used to draw the figures (i.e.
23612361
``fig.canvas.get_renderer()``)
23622362

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def composite_images(images, renderer, magnification=1.0):
6969
enforced by this function. Each image must have a purely
7070
affine transformation with no shear.
7171
72-
renderer : RendererBase instance
72+
renderer : `.RendererBase`
7373
7474
magnification : float
7575
The additional magnification to apply for the renderer in use.

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ def get_tightbbox(self, renderer):
950950
951951
Parameters
952952
----------
953-
renderer : `.RendererBase` instance
953+
renderer : `.RendererBase` subclass
954954
renderer that will be used to draw the figures (i.e.
955955
``fig.canvas.get_renderer()``)
956956

lib/matplotlib/legend_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ def legend_artist(self, legend, orig_handle,
9494
9595
Parameters
9696
----------
97-
legend : :class:`matplotlib.legend.Legend` instance
97+
legend : `~matplotlib.legend.Legend`
9898
The legend for which these legend artists are being created.
9999
orig_handle : :class:`matplotlib.artist.Artist` or similar
100100
The object for which these legend artists are being created.
101101
fontsize : int
102102
The fontsize in pixels. The artists being created should
103103
be scaled according to the given fontsize.
104-
handlebox : :class:`matplotlib.offsetbox.OffsetBox` instance
104+
handlebox : `matplotlib.offsetbox.OffsetBox`
105105
The box which has been created to hold this legend entry's
106106
artists. Artists created in the `legend_artist` method must
107107
be added to this handlebox inside this method.

lib/matplotlib/patheffects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, path_effects, renderer):
8484
----------
8585
path_effects : iterable of :class:`AbstractPathEffect`
8686
The path effects which this renderer represents.
87-
renderer : :class:`matplotlib.backend_bases.RendererBase` instance
87+
renderer : `matplotlib.backend_bases.RendererBase` subclass
8888
8989
"""
9090
self._path_effects = path_effects

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10291029
-------
10301030
fig : `~.figure.Figure`
10311031
1032-
ax : `.axes.Axes` object or array of Axes objects.
1032+
ax : `.axes.Axes` or array of Axes
10331033
*ax* can be either a single `~matplotlib.axes.Axes` object or an
10341034
array of Axes objects if more than one subplot was created. The
10351035
dimensions of the resulting array can be controlled with the squeeze

lib/matplotlib/textpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_text_path(self, prop, s, ismath=False, usetex=False):
9797
9898
Parameters
9999
----------
100-
prop : `matplotlib.font_manager.FontProperties` instance
100+
prop : `~matplotlib.font_manager.FontProperties`
101101
The font properties for the text.
102102
103103
s : str

lib/matplotlib/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,7 @@ def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
29022902
29032903
Parameters
29042904
----------
2905-
trans : :class:`Transform` instance
2905+
trans : `Transform` subclass
29062906
Any transform, to which offset will be applied.
29072907
fig : :class:`~matplotlib.figure.Figure`, default: None
29082908
Current figure. It can be None if *units* are 'dots'.
@@ -2913,7 +2913,7 @@ def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
29132913
29142914
Returns
29152915
-------
2916-
trans : :class:`Transform` instance
2916+
trans : `Transform` subclass
29172917
Transform with applied offset.
29182918
"""
29192919
if units == 'dots':

lib/matplotlib/tri/triinterpolate.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,13 @@ class LinearTriInterpolator(TriInterpolator):
241241
242242
Parameters
243243
----------
244-
triangulation : :class:`~matplotlib.tri.Triangulation` object
244+
triangulation : `~matplotlib.tri.Triangulation`
245245
The triangulation to interpolate over.
246246
z : array-like of shape (npoints,)
247247
Array of values, defined at grid points, to interpolate between.
248-
trifinder : :class:`~matplotlib.tri.TriFinder` object, optional
248+
trifinder : `~matplotlib.tri.TriFinder`, optional
249249
If this is not specified, the Triangulation's default TriFinder will
250-
be used by calling
251-
:func:`matplotlib.tri.Triangulation.get_trifinder`.
250+
be used by calling `matplotlib.tri.Triangulation.get_trifinder`.
252251
253252
Methods
254253
-------
@@ -305,7 +304,7 @@ class CubicTriInterpolator(TriInterpolator):
305304
306305
Parameters
307306
----------
308-
triangulation : :class:`~matplotlib.tri.Triangulation` object
307+
triangulation : `~matplotlib.tri.Triangulation`
309308
The triangulation to interpolate over.
310309
z : array-like of shape (npoints,)
311310
Array of values, defined at grid points, to interpolate between.
@@ -321,10 +320,9 @@ class CubicTriInterpolator(TriInterpolator):
321320
- if 'user': The user provides the argument *dz*, no computation
322321
is hence needed.
323322
324-
trifinder : :class:`~matplotlib.tri.TriFinder` object, optional
323+
trifinder : `~matplotlib.tri.TriFinder`, optional
325324
If not specified, the Triangulation's default TriFinder will
326-
be used by calling
327-
:func:`matplotlib.tri.Triangulation.get_trifinder`.
325+
be used by calling `matplotlib.tri.Triangulation.get_trifinder`.
328326
dz : tuple of array-likes (dzdx, dzdy), optional
329327
Used only if *kind* ='user'. In this case *dz* must be provided as
330328
(dzdx, dzdy) where dzdx, dzdy are arrays of the same shape as *z* and

lib/matplotlib/tri/trirefine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def refine_field(self, z, triinterpolator=None, subdiv=3):
155155
156156
Returns
157157
-------
158-
refi_tri : :class:`~matplotlib.tri.Triangulation` object
158+
refi_tri : `~matplotlib.tri.Triangulation`
159159
The returned refined triangulation
160160
refi_z : 1d array of length: *refi_tri* node count.
161161
The returned interpolated field (at *refi_tri* nodes)

lib/matplotlib/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ class SpanSelector(_SelectorWidget):
16601660
16611661
Parameters
16621662
----------
1663-
ax : `matplotlib.axes.Axes` object
1663+
ax : `matplotlib.axes.Axes`
16641664
16651665
onselect : func(min, max), min/max are floats
16661666

tutorials/text/text_props.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
clip_path a `~matplotlib.path.Path` instance and a `~matplotlib.transforms.Transform` instance, a `~matplotlib.patches.Patch`
2222
color any matplotlib :doc:`color </tutorials/colors/colors>`
2323
family [ ``'serif'`` | ``'sans-serif'`` | ``'cursive'`` | ``'fantasy'`` | ``'monospace'`` ]
24-
fontproperties a `~matplotlib.font_manager.FontProperties` instance
24+
fontproperties `~matplotlib.font_manager.FontProperties`
2525
horizontalalignment or ha [ ``'center'`` | ``'right'`` | ``'left'`` ]
2626
label any string
2727
linespacing `float`
@@ -33,7 +33,7 @@
3333
size or fontsize [ size in points | relative size, e.g., ``'smaller'``, ``'x-large'`` ]
3434
style or fontstyle [ ``'normal'`` | ``'italic'`` | ``'oblique'`` ]
3535
text string or anything printable with '%s' conversion
36-
transform a `~matplotlib.transforms.Transform` instance
36+
transform `~matplotlib.transforms.Transform` subclass
3737
variant [ ``'normal'`` | ``'small-caps'`` ]
3838
verticalalignment or va [ ``'center'`` | ``'top'`` | ``'bottom'`` | ``'baseline'`` ]
3939
visible bool

0 commit comments

Comments
 (0)