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

Skip to content

Remove signatures that duplicate introspectable data. #13177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 10 additions & 73 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6113,12 +6113,9 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
"""
Create a pseudocolor plot with a non-regular rectangular grid.

Call signatures::
Call signature::

ax.pcolorfast(C, **kwargs)
ax.pcolorfast(xr, yr, C, **kwargs)
ax.pcolorfast(x, y, C, **kwargs)
ax.pcolorfast(X, Y, C, **kwargs)
ax.pcolorfast([X, Y], C, /, **kwargs)

This method is similar to ~.Axes.pcolor` and `~.Axes.pcolormesh`.
It's designed to provide the fastest pcolor-type plotting with the
Expand All @@ -6138,24 +6135,24 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
Parameters
----------
C : array-like(M, N)
A scalar 2D array. The values will be color-mapped.
*C* may be a masked array.
A 2D array or masked array. The values will be color-mapped.
This argument can only be passed positionally.

x, y : tuple or array-like
X, Y : tuple or array-like, default: ``(0, N)``, ``(0, M)``
*X* and *Y* are used to specify the coordinates of the
quadilaterals. There are different ways to do this:

- Use tuples ``xr=(xmin, xmax)`` and ``yr=(ymin, ymax)`` to define
- Use tuples ``X=(xmin, xmax)`` and ``Y=(ymin, ymax)`` to define
a *uniform rectiangular grid*.

The tuples define the outer edges of the grid. All individual
quadrilaterals will be of the same size. This is the fastest
version.

- Use 1D arrays *x*, *y* to specify a *non-uniform rectangular
- Use 1D arrays *X*, *Y* to specify a *non-uniform rectangular
grid*.

In this case *x* and *y* have to be monotonic 1D arrays of length
In this case *X* and *Y* have to be monotonic 1D arrays of length
*N+1* and *M+1*, specifying the x and y boundaries of the cells.

The speed is intermediate. Note: The grid is checked, and if
Expand All @@ -6172,7 +6169,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
produce faster and more compact output using ps, pdf, and
svg backends, however.

Leaving out *x* and *y* defaults to ``xr=(0, N)``, ``yr=(O, M)``.
These arguments can only be passed positionally.

cmap : str or `~matplotlib.colors.Colormap`, optional
A Colormap instance or registered colormap name. The colormap
Expand Down Expand Up @@ -6324,32 +6321,7 @@ def clabel(self, CS, *args, **kwargs):
return CS.clabel(*args, **kwargs)
clabel.__doc__ = mcontour.ContourSet.clabel.__doc__

@docstring.dedent_interpd
def table(self, **kwargs):
"""
Add a table to the current axes.

Call signature::

table(cellText=None, cellColours=None,
cellLoc='right', colWidths=None,
rowLabels=None, rowColours=None, rowLoc='left',
colLabels=None, colColours=None, colLoc='center',
loc='bottom', bbox=None)

Returns a :class:`matplotlib.table.Table` instance. Either `cellText`
or `cellColours` must be provided. For finer grained control over
tables, use the :class:`~matplotlib.table.Table` class and add it to
the axes with :meth:`~matplotlib.axes.Axes.add_table`.

Thanks to John Gill for providing the class and table.

kwargs control the :class:`~matplotlib.table.Table`
properties:

%(Table)s
"""
return mtable.table(self, **kwargs)
table = mtable.table

#### Data analysis

Expand Down Expand Up @@ -6986,12 +6958,6 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
r"""
Plot the power spectral density.

Call signature::

psd(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
sides='default', scale_by_freq=None, return_line=None, **kwargs)

The power spectral density :math:`P_{xx}` by Welch's average
periodogram method. The vector *x* is divided into *NFFT* length
segments. Each segment is detrended by function *detrend* and
Expand Down Expand Up @@ -7109,12 +7075,6 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
"""
Plot the cross-spectral density.

Call signature::

csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
sides='default', scale_by_freq=None, return_line=None, **kwargs)

The cross spectral density :math:`P_{xy}` by Welch's average
periodogram method. The vectors *x* and *y* are divided into
*NFFT* length segments. Each segment is detrended by function
Expand Down Expand Up @@ -7221,11 +7181,6 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
"""
Plot the magnitude spectrum.

Call signature::

magnitude_spectrum(x, Fs=2, Fc=0, window=mlab.window_hanning,
pad_to=None, sides='default', **kwargs)

Compute the magnitude spectrum of *x*. Data is padded to a
length of *pad_to* and the windowing function *window* is applied to
the signal.
Expand Down Expand Up @@ -7323,11 +7278,6 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
"""
Plot the angle spectrum.

Call signature::

angle_spectrum(x, Fs=2, Fc=0, window=mlab.window_hanning,
pad_to=None, sides='default', **kwargs)

Compute the angle spectrum (wrapped phase spectrum) of *x*.
Data is padded to a length of *pad_to* and the windowing function
*window* is applied to the signal.
Expand Down Expand Up @@ -7405,11 +7355,6 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
"""
Plot the phase spectrum.

Call signature::

phase_spectrum(x, Fs=2, Fc=0, window=mlab.window_hanning,
pad_to=None, sides='default', **kwargs)

Compute the phase spectrum (unwrapped angle spectrum) of *x*.
Data is padded to a length of *pad_to* and the windowing function
*window* is applied to the signal.
Expand Down Expand Up @@ -7554,14 +7499,6 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
"""
Plot a spectrogram.

Call signature::

specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=128,
cmap=None, xextent=None, pad_to=None, sides='default',
scale_by_freq=None, mode='default', scale='default',
**kwargs)

Compute and plot a spectrogram of data in *x*. Data are split into
*NFFT* length segments and the spectrum of each section is
computed. The windowing function *window* is applied to each
Expand Down
18 changes: 3 additions & 15 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,15 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,
This should *NOT* be used to get zero padding, or the scaling of the
result will be incorrect. Use *pad_to* for this instead.

detrend : {'default', 'constant', 'mean', 'linear', 'none'} or callable
detrend : {'none', 'mean', 'linear'} or callable, default 'none'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function applied to each segment before fft-ing, designed to
remove the mean or linear trend. Unlike in MATLAB, where the
*detrend* parameter is a vector, in Matplotlib is it a function.
The :mod:`~matplotlib.mlab` module defines `.detrend_none`,
`.detrend_mean`, and `.detrend_linear`, but you can use a custom
function as well. You can also use a string to choose one of the
functions. 'default', 'constant', and 'mean' call `.detrend_mean`.
'linear' calls `.detrend_linear`. 'none' calls `.detrend_none`.
functions: 'none' calls `.detrend_none`. 'mean' calls `.detrend_mean`.
'linear' calls `.detrend_linear`.

scale_by_freq : bool, optional
Specifies whether the resulting density values should be scaled
Expand All @@ -693,12 +693,6 @@ def psd(x, NFFT=None, Fs=None, detrend=None, window=None,
r"""
Compute the power spectral density.

Call signature::

psd(x, NFFT=256, Fs=2, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
sides='default', scale_by_freq=None)

The power spectral density :math:`P_{xx}` by Welch's average
periodogram method. The vector *x* is divided into *NFFT* length
segments. Each segment is detrended by function *detrend* and
Expand Down Expand Up @@ -756,12 +750,6 @@ def csd(x, y, NFFT=None, Fs=None, detrend=None, window=None,
"""
Compute the cross-spectral density.

Call signature::

csd(x, y, NFFT=256, Fs=2, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
sides='default', scale_by_freq=None)

The cross spectral density :math:`P_{xy}` by Welch's average
periodogram method. The vectors *x* and *y* are divided into
*NFFT* length segments. Each segment is detrended by function
Expand Down
20 changes: 14 additions & 6 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,8 +1445,7 @@ def xticks(ticks=None, labels=None, **kwargs):

Call signatures::

locs, labels = xticks() # Get locations and labels

locs, labels = xticks() # Get locations and labels
xticks(ticks, [labels], **kwargs) # Set locations and labels

Parameters
Expand Down Expand Up @@ -1522,8 +1521,7 @@ def yticks(ticks=None, labels=None, **kwargs):

Call signatures::

locs, labels = yticks() # Get locations and labels

locs, labels = yticks() # Get locations and labels
yticks(ticks, [labels], **kwargs) # Set locations and labels

Parameters
Expand Down Expand Up @@ -2923,8 +2921,18 @@ def streamplot(

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.table)
def table(**kwargs):
return gca().table(**kwargs)
def table(
cellText=None, cellColours=None, cellLoc='right',
colWidths=None, rowLabels=None, rowColours=None,
rowLoc='left', colLabels=None, colColours=None,
colLoc='center', loc='bottom', bbox=None, edges='closed',
**kwargs):
return gca().table(
cellText=cellText, cellColours=cellColours, cellLoc=cellLoc,
colWidths=colWidths, rowLabels=rowLabels,
rowColours=rowColours, rowLoc=rowLoc, colLabels=colLabels,
colColours=colColours, colLoc=colLoc, loc=loc, bbox=bbox,
edges=edges, **kwargs)


# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
Expand Down
15 changes: 10 additions & 5 deletions lib/matplotlib/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@ def get_celld(self):
return self._cells


docstring.interpd.update(Table=artist.kwdoc(Table))


@docstring.dedent_interpd
def table(ax,
cellText=None, cellColours=None,
cellLoc='right', colWidths=None,
Expand All @@ -675,6 +679,9 @@ def table(ax,
using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*,
*colLoc* respectively.

For finer grained control over tables, use the `.Table` class and add it to
the axes with `.Axes.add_table`.

Parameters
----------
cellText : 2D list of str, optional
Expand Down Expand Up @@ -726,13 +733,14 @@ def table(ax,
Other Parameters
----------------
**kwargs
`.Artist` properties.
`.Table` properties.

%(Table)s

Returns
-------
table : `~matplotlib.table.Table`
The created table.

"""

if cellColours is None and cellText is None:
Expand Down Expand Up @@ -829,6 +837,3 @@ def table(ax,

ax.add_table(table)
return table


docstring.interpd.update(Table=artist.kwdoc(Table))
8 changes: 2 additions & 6 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2734,19 +2734,15 @@ def calc_arrow(uvw, angle=15):

def voxels(self, *args, facecolors=None, edgecolors=None, **kwargs):
"""
ax.voxels([x, y, z,] /, filled, **kwargs)
ax.voxels([x, y, z,] /, filled, facecolors=None, edgecolors=None, \
**kwargs)

Plot a set of filled voxels

All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0]
placed with its lower corner at the origin. Occluded faces are not
plotted.

Call signatures::

voxels(filled, facecolors=fc, edgecolors=ec, **kwargs)
voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)

.. versionadded:: 2.1

Parameters
Expand Down