From ff4ac6ddfc9165b964354166838b77e0761f4c20 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 7 Jun 2018 15:49:22 +0200 Subject: [PATCH] Replace ACCEPTS by standard numpydoc params table. (In the cases where this is "easy".) --- lib/matplotlib/artist.py | 20 +-- lib/matplotlib/axes/_base.py | 18 +-- lib/matplotlib/axis.py | 73 ++++++--- lib/matplotlib/cm.py | 8 +- lib/matplotlib/collections.py | 51 ++++--- lib/matplotlib/container.py | 4 +- lib/matplotlib/figure.py | 31 ++-- lib/matplotlib/image.py | 43 ++++-- lib/matplotlib/legend.py | 1 - lib/matplotlib/lines.py | 127 ++++++++------- lib/matplotlib/patches.py | 100 +++++++----- lib/matplotlib/quiver.py | 4 +- lib/matplotlib/spines.py | 4 +- lib/matplotlib/table.py | 6 +- lib/matplotlib/tests/test_artist.py | 2 +- lib/matplotlib/text.py | 170 +++++++++++++-------- lib/mpl_toolkits/axisartist/axis_artist.py | 20 ++- lib/mpl_toolkits/mplot3d/art3d.py | 7 +- lib/mpl_toolkits/mplot3d/axes3d.py | 4 - 19 files changed, 410 insertions(+), 283 deletions(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index c3a536c3560f..147815bc07af 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -301,7 +301,6 @@ def set_transform(self, t): Parameters ---------- t : `.Transform` - .. ACCEPTS: `.Transform` """ self._transform = t self._transformSet = True @@ -373,7 +372,6 @@ def set_contains(self, picker): Parameters ---------- picker : callable - .. ACCEPTS: a callable function """ self._contains = picker @@ -453,7 +451,6 @@ def set_picker(self, picker): Parameters ---------- picker : None or bool or float or callable - .. ACCEPTS: [None | bool | float | callable] """ self._picker = picker @@ -477,7 +474,6 @@ def set_url(self, url): Parameters ---------- url : str - .. ACCEPTS: a url string """ self._url = url @@ -492,7 +488,6 @@ def set_gid(self, gid): Parameters ---------- gid : str - .. ACCEPTS: an id string """ self._gid = gid @@ -530,7 +525,6 @@ def set_snap(self, snap): Parameters ---------- snap : bool or None - .. ACCEPTS: bool or None """ self._snap = snap self.stale = True @@ -591,7 +585,6 @@ def set_path_effects(self, path_effects): Parameters ---------- path_effects : `.AbstractPathEffect` - .. ACCEPTS: `.AbstractPathEffect` """ self._path_effects = path_effects self.stale = True @@ -610,7 +603,6 @@ def set_figure(self, fig): Parameters ---------- fig : `.Figure` - .. ACCEPTS: a `.Figure` instance """ # if this is a no-op just return if self.figure is fig: @@ -635,7 +627,6 @@ def set_clip_box(self, clipbox): Parameters ---------- clipbox : `.Bbox` - .. ACCEPTS: a `.Bbox` instance """ self.clipbox = clipbox self.pchanged() @@ -742,7 +733,6 @@ def set_clip_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._clipon = b # This may result in the callbacks being hit twice, but ensures they @@ -773,7 +763,6 @@ def set_rasterized(self, rasterized): Parameters ---------- rasterized : bool or None - .. ACCEPTS: bool or None """ if rasterized and not hasattr(self.draw, "_supports_rasterization"): warnings.warn("Rasterization of '%s' will be ignored" % self) @@ -807,13 +796,11 @@ def draw(self, renderer, *args, **kwargs): def set_alpha(self, alpha): """ - Set the alpha value used for blending - not supported on - all backends. + Set the alpha value used for blending - not supported on all backends. Parameters ---------- alpha : float - .. ACCEPTS: float (0.0 transparent through 1.0 opaque) """ self._alpha = alpha self.pchanged() @@ -826,7 +813,6 @@ def set_visible(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._visible = b self.pchanged() @@ -839,7 +825,6 @@ def set_animated(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ if self._animated != b: self._animated = b @@ -895,8 +880,6 @@ def set_label(self, s): ---------- s : object *s* will be converted to a string by calling `str`. - - .. ACCEPTS: object """ if s is not None: self._label = str(s) @@ -917,7 +900,6 @@ def set_zorder(self, level): Parameters ---------- level : float - .. ACCEPTS: float """ if level is None: level = self.__class__.zorder diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index d2f5a694088d..db9d71a5659f 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -1363,11 +1363,9 @@ def set_anchor(self, anchor, share=False): anchor defines where the drawing area will be located within the available space. - .. ACCEPTS: [ 'C' | 'SW' | 'S' | 'SE' | 'E' | 'NE' | 'N' | 'NW' | 'W' ] - Parameters ---------- - anchor : str or 2-tuple of floats + anchor : 2-tuple of floats or {'C', 'SW', 'S', 'SE', ...} The anchor position may be either: - a sequence (*cx*, *cy*). *cx* and *cy* may range from 0 @@ -3145,11 +3143,9 @@ def set_xscale(self, value, **kwargs): """ Set the x-axis scale. - .. ACCEPTS: [ 'linear' | 'log' | 'symlog' | 'logit' | ... ] - Parameters ---------- - value : {"linear", "log", "symlog", "logit"} + value : {"linear", "log", "symlog", "logit", ...} scaling strategy to apply Notes @@ -3183,8 +3179,6 @@ def set_xticks(self, ticks, minor=False): """ Set the x ticks with list of *ticks* - .. ACCEPTS: list of tick locations. - Parameters ---------- ticks : list @@ -3482,11 +3476,9 @@ def set_yscale(self, value, **kwargs): """ Set the y-axis scale. - .. ACCEPTS: [ 'linear' | 'log' | 'symlog' | 'logit' | ... ] - Parameters ---------- - value : {"linear", "log", "symlog", "logit"} + value : {"linear", "log", "symlog", "logit", ...} scaling strategy to apply Notes @@ -3519,11 +3511,9 @@ def set_yticks(self, ticks, minor=False): """ Set the y ticks with list of *ticks* - .. ACCEPTS: list of tick locations. - Parameters ---------- - ticks : sequence + ticks : list List of y-axis tick locations minor : bool, optional diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index a659507b9b08..8ca2209b3a0f 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -251,7 +251,9 @@ def set_pad(self, val): """ Set the tick label pad in points - ACCEPTS: float + Parameters + ---------- + val : float """ self._apply_params(pad=val) self.stale = True @@ -308,9 +310,11 @@ def draw(self, renderer): def set_label1(self, s): """ - Set the text of ticklabel + Set the label1 text. - ACCEPTS: str + Parameters + ---------- + s : str """ self.label1.set_text(s) self.stale = True @@ -319,9 +323,11 @@ def set_label1(self, s): def set_label2(self, s): """ - Set the text of ticklabel2 + Set the label2 text. - ACCEPTS: str + Parameters + ---------- + s : str """ self.label2.set_text(s) self.stale = True @@ -1538,7 +1544,8 @@ def get_units(self): return self.units def set_label_text(self, label, fontdict=None, **kwargs): - """ Sets the text value of the axis label + """ + Set the text value of the axis label. ACCEPTS: A string value for the label """ @@ -1552,9 +1559,11 @@ def set_label_text(self, label, fontdict=None, **kwargs): def set_major_formatter(self, formatter): """ - Set the formatter of the major ticker + Set the formatter of the major ticker. - ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance + Parameters + ---------- + formatter : ~matplotlib.ticker.Formatter """ if not isinstance(formatter, mticker.Formatter): raise TypeError("formatter argument should be instance of " @@ -1566,9 +1575,11 @@ def set_major_formatter(self, formatter): def set_minor_formatter(self, formatter): """ - Set the formatter of the minor ticker + Set the formatter of the minor ticker. - ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance + Parameters + ---------- + formatter : ~matplotlib.ticker.Formatter """ if not isinstance(formatter, mticker.Formatter): raise TypeError("formatter argument should be instance of " @@ -1580,9 +1591,11 @@ def set_minor_formatter(self, formatter): def set_major_locator(self, locator): """ - Set the locator of the major ticker + Set the locator of the major ticker. - ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance + Parameters + ---------- + locator : ~matplotlib.ticker.Locator """ if not isinstance(locator, mticker.Locator): raise TypeError("formatter argument should be instance of " @@ -1594,9 +1607,11 @@ def set_major_locator(self, locator): def set_minor_locator(self, locator): """ - Set the locator of the minor ticker + Set the locator of the minor ticker. - ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance + Parameters + ---------- + locator : ~matplotlib.ticker.Locator """ if not isinstance(locator, mticker.Locator): raise TypeError("formatter argument should be instance of " @@ -1608,9 +1623,11 @@ def set_minor_locator(self, locator): def set_pickradius(self, pickradius): """ - Set the depth of the axis used by the picker + Set the depth of the axis used by the picker. - ACCEPTS: a distance in points + Parameters + ---------- + pickradius : float """ self.pickradius = pickradius @@ -1749,7 +1766,9 @@ def set_label_position(self, position): """ Set the label position (top or bottom) - ACCEPTS: [ 'top' | 'bottom' ] + Parameters + ---------- + position : {'top', 'bottom'} """ raise NotImplementedError() @@ -1859,7 +1878,9 @@ def set_label_position(self, position): """ Set the label position (top or bottom) - ACCEPTS: [ 'top' | 'bottom' ] + Parameters + ---------- + position : {'top', 'bottom'} """ if position == 'top': self.label.set_verticalalignment('baseline') @@ -1978,7 +1999,9 @@ def set_ticks_position(self, position): can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels. - ACCEPTS: [ 'top' | 'bottom' | 'both' | 'default' | 'none' ] + Parameters + ---------- + position : {'top', 'bottom', 'both', 'default', 'none'} """ if position == 'top': self.set_tick_params(which='both', top=True, labeltop=True, @@ -2226,7 +2249,9 @@ def set_label_position(self, position): """ Set the label position (left or right) - ACCEPTS: [ 'left' | 'right' ] + Parameters + ---------- + position : {'left', 'right'} """ self.label.set_rotation_mode('anchor') self.label.set_horizontalalignment('center') @@ -2313,7 +2338,9 @@ def _update_offset_text_position(self, bboxes, bboxes2): def set_offset_position(self, position): """ - .. ACCEPTS: [ 'left' | 'right' ] + Parameters + ---------- + position : {'left', 'right'} """ x, y = self.offsetText.get_position() if position == 'left': @@ -2354,7 +2381,9 @@ def set_ticks_position(self, position): can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels. - ACCEPTS: [ 'left' | 'right' | 'both' | 'default' | 'none' ] + Parameters + ---------- + position : {'left', 'right', 'both', 'default', 'none'} """ if position == 'right': self.set_tick_params(which='both', right=True, labelright=True, diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index 4e8abedf1e9e..3eb4860c98ce 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -275,8 +275,6 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True): def set_array(self, A): """Set the image array from numpy array *A*. - .. ACCEPTS: ndarray - Parameters ---------- A : ndarray @@ -320,7 +318,9 @@ def set_cmap(self, cmap): """ set the colormap for luminance data - ACCEPTS: a colormap or registered colormap name + Parameters + ---------- + cmap : colormap or registered colormap name """ cmap = get_cmap(cmap) self.cmap = cmap @@ -329,8 +329,6 @@ def set_cmap(self, cmap): def set_norm(self, norm): """Set the normalization instance. - .. ACCEPTS: `.Normalize` - Parameters ---------- norm : `.Normalize` diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 59f6bfca5986..6dc4ec4152ff 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -338,8 +338,6 @@ def draw(self, renderer): def set_pickradius(self, pr): """Set the pick radius used for containment tests. - .. ACCEPTS: float distance in points - Parameters ---------- d : float @@ -384,7 +382,6 @@ def set_urls(self, urls): Parameters ---------- urls : List[str] or None - .. ACCEPTS: List[str] or None """ self._urls = urls if urls is not None else [None] self.stale = True @@ -420,7 +417,9 @@ def set_hatch(self, hatch): can only be specified for the collection as a whole, not separately for each member. - ACCEPTS: [ '/' | '\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*' ] + Parameters + ---------- + hatch : {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} """ self._hatch = hatch self.stale = True @@ -434,7 +433,9 @@ def set_offsets(self, offsets): Set the offsets for the collection. *offsets* can be a scalar or a sequence. - ACCEPTS: float or sequence of floats + Parameters + ---------- + offsets : float or sequence of floats """ offsets = np.asanyarray(offsets, float) if offsets.shape == (2,): # Broadcast (2,) -> (1, 2) but nothing else. @@ -462,7 +463,9 @@ def set_offset_position(self, offset_position): If offset_position is 'data', the offset is applied before the master transform, i.e., the offsets are in data coordinates. - .. ACCEPTS: [ 'screen' | 'data' ] + Parameters + ---------- + offset_position : {'screen', 'data'} """ if offset_position not in ('screen', 'data'): raise ValueError("offset_position must be 'screen' or 'data'") @@ -486,7 +489,9 @@ def set_linewidth(self, lw): or a sequence; if it is a sequence the patches will cycle through the sequence - ACCEPTS: float or sequence of floats + Parameters + ---------- + lw : float or sequence of floats """ if lw is None: lw = mpl.rcParams['patch.linewidth'] @@ -517,17 +522,11 @@ def set_linestyle(self, ls): (offset, onoffseq), - where ``onoffseq`` is an even length tuple of on and off ink - in points. - - ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | - (offset, on-off-dash-seq) | - ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` | - ``' '`` | ``''``] + where ``onoffseq`` is an even length tuple of on and off ink in points. Parameters ---------- - ls : { '-', '--', '-.', ':'} and more see description + ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} The line style. """ try: @@ -631,7 +630,9 @@ def set_antialiased(self, aa): """ Set the antialiasing state for rendering. - ACCEPTS: Boolean or sequence of booleans + Parameters + ---------- + aa : bool or sequence of bools """ if aa is None: aa = mpl.rcParams['patch.antialiased'] @@ -642,12 +643,14 @@ def set_color(self, c): """ Set both the edgecolor and the facecolor. - ACCEPTS: matplotlib color arg or sequence of rgba tuples - .. seealso:: :meth:`set_facecolor`, :meth:`set_edgecolor` For setting the edge or face color individually. + + Parameters + ---------- + c : matplotlib color arg or sequence of rgba tuples """ self.set_facecolor(c) self.set_edgecolor(c) @@ -674,7 +677,9 @@ def set_facecolor(self, c): If *c* is 'none', the patch will not be filled. - ACCEPTS: matplotlib color spec or sequence of specs + Parameters + ---------- + c : color or sequence of colors """ self._original_facecolor = c self._set_facecolor(c) @@ -727,7 +732,9 @@ def set_edgecolor(self, c): the face color. If it is 'none', the patch boundary will not be drawn. - ACCEPTS: matplotlib color spec or sequence of specs + Parameters + ---------- + c : color or sequence of colors """ self._original_edgecolor = c self._set_edgecolor(c) @@ -737,7 +744,9 @@ def set_alpha(self, alpha): Set the alpha tranparencies of the collection. *alpha* must be a float or *None*. - ACCEPTS: float or None + Parameters + ---------- + alpha : float or None """ if alpha is not None: try: diff --git a/lib/matplotlib/container.py b/lib/matplotlib/container.py index 73ce21355fa8..552d6da5a761 100644 --- a/lib/matplotlib/container.py +++ b/lib/matplotlib/container.py @@ -50,7 +50,9 @@ def set_label(self, s): """ Set the label to *s* for auto legend. - ACCEPTS: string or anything printable with '%s' conversion. + Parameters + ---------- + s : string or anything printable with '%s' conversion. """ if s is not None: self._label = '%s' % (s, ) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index e898f9082acd..718ad11803f9 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -488,11 +488,6 @@ def set_tight_layout(self, tight): If ``None``, use the ``figure.autolayout`` rcparam instead. If a dict, pass it as kwargs to `.tight_layout`, overriding the default paddings. - - .. - ACCEPTS: [ bool - | dict with keys "pad", "w_pad", "h_pad", "rect" - | None ] """ if tight is None: tight = rcParams['figure.autolayout'] @@ -518,9 +513,11 @@ def set_constrained_layout(self, constrained): overridden. These pads are in inches and default to 3.0/72.0. ``w_pad`` is the width padding and ``h_pad`` is the height padding. - ACCEPTS: [True | False | dict | None ] - See :doc:`/tutorials/intermediate/constrainedlayout_guide`. + + Parameters + ---------- + constrained : bool or dict or None """ self._constrained_layout_pads = dict() self._constrained_layout_pads['w_pad'] = None @@ -778,7 +775,9 @@ def set_canvas(self, canvas): """ Set the canvas that contains the figure - ACCEPTS: a FigureCanvas instance + Parameters + ---------- + canvas : FigureCanvas """ self.canvas = canvas @@ -951,7 +950,9 @@ def set_edgecolor(self, color): """ Set the edge color of the Figure rectangle. - ACCEPTS: any matplotlib color - see help(colors) + Parameters + ---------- + color : color """ self.patch.set_edgecolor(color) @@ -959,7 +960,9 @@ def set_facecolor(self, color): """ Set the face color of the Figure rectangle. - ACCEPTS: any matplotlib color - see help(colors) + Parameters + ---------- + color : color """ self.patch.set_facecolor(color) @@ -967,7 +970,9 @@ def set_dpi(self, val): """ Set the resolution of the figure in dots-per-inch. - .. ACCEPTS: float + Parameters + ---------- + val : float """ self.dpi = val self.stale = True @@ -992,7 +997,9 @@ def set_frameon(self, b): """ Set whether the figure frame (background) is displayed or invisible. - ACCEPTS: boolean + Parameters + ---------- + b : bool """ self.frameon = b self.stale = True diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index d616a1572bd3..5e25d7aa2531 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -237,10 +237,11 @@ def get_size(self): def set_alpha(self, alpha): """ - Set the alpha value used for blending - not supported on - all backends + Set the alpha value used for blending - not supported on all backends. - ACCEPTS: float + Parameters + ---------- + alpha : float """ martist.Artist.set_alpha(self, alpha) self._imcache = None @@ -620,9 +621,11 @@ def set_data(self, A): """ Set the image array. - ACCEPTS: numpy/PIL Image A - Note that this function does *not* update the normalization used. + + Parameters + ---------- + A : array-like """ # check if data is PIL Image without importing Image if hasattr(A, 'getpixel'): @@ -665,13 +668,14 @@ def set_data(self, A): def set_array(self, A): """ - Retained for backwards compatibility - use set_data instead + Retained for backwards compatibility - use set_data instead. - ACCEPTS: numpy array A or PIL Image + Parameters + ---------- + A : array-like """ # This also needs to be here to override the inherited - # cm.ScalarMappable.set_array method so it is not invoked - # by mistake. + # cm.ScalarMappable.set_array method so it is not invoked by mistake. self.set_data(A) @@ -695,10 +699,11 @@ def set_interpolation(self, s): agg, ps and pdf backends and will fall back to 'nearest' mode for other backends. - .. ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' | - 'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' | - 'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' | - 'sinc' | 'lanczos' | 'none' ] + Parameters + ---------- + s : {'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', \ +'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', \ +'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} """ if s is None: @@ -723,7 +728,9 @@ def set_resample(self, v): """ Set whether or not image resampling is used. - ACCEPTS: True|False + Parameters + ---------- + v : bool """ if v is None: v = rcParams['image.resample'] @@ -740,7 +747,9 @@ def set_filternorm(self, filternorm): See help for `~.Axes.imshow`. - .. ACCEPTS: bool + Parameters + ---------- + filternorm : bool """ self._filternorm = bool(filternorm) self.stale = True @@ -754,7 +763,9 @@ def set_filterrad(self, filterrad): Set the resize filter radius only applicable to some interpolation schemes -- see help for imshow - ACCEPTS: positive float + Parameters + ---------- + filterrad : positive float """ r = float(filterrad) if r <= 0: diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 5d2a50035360..25a57a5e6e98 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -991,7 +991,6 @@ def set_frame_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._drawFrame = b self.stale = True diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index b9769574dc90..6736e616b680 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -504,8 +504,6 @@ def get_pickradius(self): def set_pickradius(self, d): """Set the pick radius used for containment tests. - .. ACCEPTS: float distance in points - Parameters ---------- d : float @@ -524,7 +522,9 @@ def set_fillstyle(self, fs): Set the marker fill style; 'full' means fill the whole marker. 'none' means no filling; other options are for half-filled markers. - ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top' | 'none'] + Parameters + ---------- + fs : {'full', 'left', 'right', 'bottom', 'top', 'none'} """ self._marker.set_fillstyle(fs) self.stale = True @@ -534,13 +534,10 @@ def set_markevery(self, every): e.g., if `every=5`, every 5-th marker will be plotted. - ACCEPTS: [None | int | length-2 tuple of int | slice | - list/array of int | float | length-2 tuple of float] - Parameters ---------- - every: None | int | length-2 tuple of int | slice | list/array of int \ -| float | length-2 tuple of float + every: None or int or (int, int) or slice or List[int] or float or \ +(float, float) Which markers to plot. - every=None, every point will be plotted. @@ -549,7 +546,7 @@ def set_markevery(self, every): - every=(start, N), every N-th marker, starting at point start, will be plotted. - every=slice(start, end, N), every N-th marker, starting at - point start, upto but not including point end, will be plotted. + point start, up to but not including point end, will be plotted. - every=[i, j, m, n], only markers at points i, j, m, and n will be plotted. - every=0.1, (i.e. a float) then markers will be spaced at @@ -591,8 +588,10 @@ def get_markevery(self): def set_picker(self, p): """Sets the event picker details for the line. - ACCEPTS: float distance in points or callable pick function - ``fn(artist, event)`` + Parameters + ---------- + p : float or callable[[Artist, Event], Tuple[bool, dict]] + If a float, it is used as the pick radius in points. """ if callable(p): self._contains = p @@ -711,7 +710,9 @@ def set_transform(self, t): """ set the Transformation instance used by this artist - ACCEPTS: a :class:`matplotlib.transforms.Transform` instance + Parameters + ---------- + t : matplotlib.transforms.Transform """ Artist.set_transform(self, t) self._invalidx = True @@ -952,7 +953,6 @@ def set_antialiased(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ if self._antialiased != b: self.stale = True @@ -962,7 +962,9 @@ def set_color(self, color): """ Set the color of the line - ACCEPTS: any matplotlib color + Parameters + ---------- + color : color """ self._color = color self.stale = True @@ -975,8 +977,10 @@ def set_drawstyle(self, drawstyle): produce step-plots. 'steps' is equivalent to 'steps-pre' and is maintained for backward-compatibility. - ACCEPTS: ['default' | 'steps' | 'steps-pre' | 'steps-mid' | - 'steps-post'] + Parameters + ---------- + drawstyle : {'default', 'steps', 'steps-pre', 'steps-mid', \ +'steps-post'} """ if drawstyle is None: drawstyle = 'default' @@ -992,7 +996,9 @@ def set_linewidth(self, w): """ Set the line width in points - ACCEPTS: float value in points + Parameters + ---------- + w : float """ w = float(w) @@ -1053,14 +1059,7 @@ def set_linestyle(self, ls): (offset, onoffseq), - where ``onoffseq`` is an even length tuple of on and off ink - in points. - - - ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | - (offset, on-off-dash-seq) | - ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` | - ``' '`` | ``''``] + where ``onoffseq`` is an even length tuple of on and off ink in points. .. seealso:: @@ -1069,7 +1068,7 @@ def set_linestyle(self, ls): Parameters ---------- - ls : { ``'-'``, ``'--'``, ``'-.'``, ``':'``} and more see description + ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} The line style. """ if isinstance(ls, str): @@ -1100,26 +1099,24 @@ def set_linestyle(self, ls): @docstring.dedent_interpd def set_marker(self, marker): """ - Set the line marker - - ACCEPTS: :mod:`A valid marker style ` + Set the line marker. Parameters ---------- - marker: marker style See `~matplotlib.markers` for full description of possible - argument - + arguments. """ self._marker.set_marker(marker) self.stale = True def set_markeredgecolor(self, ec): """ - Set the marker edge color + Set the marker edge color. - ACCEPTS: any matplotlib color + Parameters + ---------- + ec : color """ if ec is None: ec = 'auto' @@ -1130,9 +1127,11 @@ def set_markeredgecolor(self, ec): def set_markeredgewidth(self, ew): """ - Set the marker edge width in points + Set the marker edge width in points. - ACCEPTS: float value in points + Parameters + ---------- + ew : float """ if ew is None: ew = rcParams['lines.markeredgewidth'] @@ -1144,7 +1143,9 @@ def set_markerfacecolor(self, fc): """ Set the marker face color. - ACCEPTS: any matplotlib color + Parameters + ---------- + fc : color """ if fc is None: fc = 'auto' @@ -1156,7 +1157,9 @@ def set_markerfacecoloralt(self, fc): """ Set the alternate marker face color. - ACCEPTS: any matplotlib color + Parameters + ---------- + fc : color """ if fc is None: fc = 'auto' @@ -1166,9 +1169,11 @@ def set_markerfacecoloralt(self, fc): def set_markersize(self, sz): """ - Set the marker size in points + Set the marker size in points. - ACCEPTS: float + Parameters + ---------- + sz : float """ sz = float(sz) if self._markersize != sz: @@ -1177,9 +1182,11 @@ def set_markersize(self, sz): def set_xdata(self, x): """ - Set the data np.array for x + Set the data array for x. - ACCEPTS: 1D array + Parameters + ---------- + x : 1D array """ self._xorig = x self._invalidx = True @@ -1187,9 +1194,11 @@ def set_xdata(self, x): def set_ydata(self, y): """ - Set the data np.array for y + Set the data array for y. - ACCEPTS: 1D array + Parameters + ---------- + y : 1D array """ self._yorig = y self._invalidy = True @@ -1201,7 +1210,9 @@ def set_dashes(self, seq): points. If seq is empty or if seq = (None, None), the linestyle will be set to solid. - ACCEPTS: sequence of on/off ink in points + Parameters + ---------- + seq : sequence of floats (on/off ink in points) or (None, None) """ if seq == (None, None) or len(seq) == 0: self.set_linestyle('-') @@ -1238,8 +1249,11 @@ def _get_rgba_face(self, alt=False): def set_dash_joinstyle(self, s): """ - Set the join style for dashed linestyles - ACCEPTS: ['miter' | 'round' | 'bevel'] + Set the join style for dashed linestyles. + + Parameters + ---------- + s : {'miter', 'round', 'bevel'} """ s = s.lower() if s not in self.validJoin: @@ -1251,8 +1265,11 @@ def set_dash_joinstyle(self, s): def set_solid_joinstyle(self, s): """ - Set the join style for solid linestyles - ACCEPTS: ['miter' | 'round' | 'bevel'] + Set the join style for solid linestyles. + + Parameters + ---------- + s : {'miter', 'round', 'bevel'} """ s = s.lower() if s not in self.validJoin: @@ -1277,9 +1294,11 @@ def get_solid_joinstyle(self): def set_dash_capstyle(self, s): """ - Set the cap style for dashed linestyles + Set the cap style for dashed linestyles. - ACCEPTS: ['butt' | 'round' | 'projecting'] + Parameters + ---------- + s : {'butt', 'round', 'projecting'} """ s = s.lower() if s not in self.validCap: @@ -1291,9 +1310,11 @@ def set_dash_capstyle(self, s): def set_solid_capstyle(self, s): """ - Set the cap style for solid linestyles + Set the cap style for solid linestyles. - ACCEPTS: ['butt' | 'round' | 'projecting'] + Parameters + ---------- + s : {'butt', 'round', 'projecting'} """ s = s.lower() if s not in self.validCap: diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index 9c5c2f3b7ed6..552fb5d61e29 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -246,7 +246,6 @@ def set_antialiased(self, aa): Parameters ---------- b : bool or None - .. ACCEPTS: bool or None """ if aa is None: aa = mpl.rcParams['patch.antialiased'] @@ -270,9 +269,11 @@ def _set_edgecolor(self, color): def set_edgecolor(self, color): """ - Set the patch edge color + Set the patch edge color. - ACCEPTS: mpl color spec, None, 'none', or 'auto' + Parameters + ---------- + color : color or None or 'auto' """ self._original_edgecolor = color self._set_edgecolor(color) @@ -286,9 +287,11 @@ def _set_facecolor(self, color): def set_facecolor(self, color): """ - Set the patch face color + Set the patch face color. - ACCEPTS: mpl color spec, or None for default, or 'none' for no color + Parameters + ---------- + color : color or None """ self._original_facecolor = color self._set_facecolor(color) @@ -297,12 +300,14 @@ def set_color(self, c): """ Set both the edgecolor and the facecolor. - ACCEPTS: matplotlib color spec - .. seealso:: :meth:`set_facecolor`, :meth:`set_edgecolor` For setting the edge or face color individually. + + Parameters + ---------- + c : color """ self.set_facecolor(c) self.set_edgecolor(c) @@ -311,7 +316,9 @@ def set_alpha(self, alpha): """ Set the alpha transparency of the patch. - ACCEPTS: float or None + Parameters + ---------- + alpha : float or None """ if alpha is not None: try: @@ -343,7 +350,7 @@ def set_linewidth(self, w): def set_linestyle(self, ls): """ - Set the patch linestyle + Set the patch linestyle. =========================== ================= linestyle description @@ -358,17 +365,11 @@ def set_linestyle(self, ls): (offset, onoffseq), - where ``onoffseq`` is an even length tuple of on and off ink - in points. - - ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | - (offset, on-off-dash-seq) | - ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` | - ``' '`` | ``''``] + where ``onoffseq`` is an even length tuple of on and off ink in points. Parameters ---------- - ls : { '-', '--', '-.', ':'} and more see description + ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} The line style. """ if ls is None: @@ -388,7 +389,6 @@ def set_fill(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._fill = bool(b) self._set_facecolor(self._original_facecolor) @@ -408,7 +408,9 @@ def set_capstyle(self, s): """ Set the patch capstyle - ACCEPTS: ['butt' | 'round' | 'projecting'] + Parameters + ---------- + s : {'butt', 'round', 'projecting'} """ s = s.lower() if s not in self.validCap: @@ -425,7 +427,9 @@ def set_joinstyle(self, s): """ Set the patch joinstyle - ACCEPTS: ['miter' | 'round' | 'bevel'] + Parameters + ---------- + s : {'miter', 'round', 'bevel'} """ s = s.lower() if s not in self.validJoin: @@ -439,13 +443,13 @@ def get_joinstyle(self): return self._joinstyle def set_hatch(self, hatch): - """ + r""" Set the hatching pattern *hatch* can be one of:: / - diagonal hatching - \\ - back diagonal + \ - back diagonal | - vertical - - horizontal + - crossed @@ -462,7 +466,9 @@ def set_hatch(self, hatch): Hatching is supported in the PostScript, PDF, SVG and Agg backends only. - ACCEPTS: ['/' | '\\\\' | '|' | '-' | '+' | 'x' | 'o' | 'O' | '.' | '*'] + Parameters + ---------- + hatch : {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} """ self._hatch = hatch self.stale = True @@ -738,9 +744,11 @@ def set_y(self, y): def set_xy(self, xy): """ - Set the left and bottom coords of the rectangle + Set the left and bottom coords of the rectangle. - ACCEPTS: 2-item sequence + Parameters + ---------- + xy : 2-item sequence """ self._x0, self._y0 = xy self._update_x1() @@ -1462,9 +1470,11 @@ def get_patch_transform(self): def set_center(self, xy): """ - Set the center of the ellipse + Set the center of the ellipse. - ACCEPTS: (x, y) + Parameters + ---------- + xy : (float, float) """ self._center = xy self.stale = True @@ -1506,7 +1516,9 @@ def set_radius(self, radius): """ Set the radius of the circle - ACCEPTS: float + Parameters + ---------- + radius : float """ self.width = self.height = 2 * radius self.stale = True @@ -2495,7 +2507,9 @@ def set_mutation_scale(self, scale): """ Set the mutation scale. - ACCEPTS: float + Parameters + ---------- + scale : float """ self._mutation_scale = scale self.stale = True @@ -2510,7 +2524,9 @@ def set_mutation_aspect(self, aspect): """ Set the aspect ratio of the bbox mutation. - ACCEPTS: float + Parameters + ---------- + aspect : float """ self._mutation_aspect = aspect self.stale = True @@ -2556,36 +2572,44 @@ def get_height(self): def set_x(self, x): """ - Set the left coord of the rectangle + Set the left coord of the rectangle. - ACCEPTS: float + Parameters + ---------- + x : float """ self._x = x self.stale = True def set_y(self, y): """ - Set the bottom coord of the rectangle + Set the bottom coord of the rectangle. - ACCEPTS: float + Parameters + ---------- + y : float """ self._y = y self.stale = True def set_width(self, w): """ - Set the width rectangle + Set the rectangle width. - ACCEPTS: float + Parameters + ---------- + w : float """ self._width = w self.stale = True def set_height(self, h): """ - Set the width rectangle + Set the rectangle height. - ACCEPTS: float + Parameters + ---------- + h : float """ self._height = h self.stale = True diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index 65a34c0874cb..68d7073b0063 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -1182,7 +1182,9 @@ def set_offsets(self, xy): in and actually sets version masked as appropriate for the existing U/V data. *offsets* should be a sequence. - ACCEPTS: sequence of pairs of floats + Parameters + ---------- + offsets : sequence of pairs of floats """ self.x = xy[:, 0] self.y = xy[:, 1] diff --git a/lib/matplotlib/spines.py b/lib/matplotlib/spines.py index a47c14a90073..a8560937bfa1 100644 --- a/lib/matplotlib/spines.py +++ b/lib/matplotlib/spines.py @@ -523,7 +523,9 @@ def set_color(self, c): """ Set the edgecolor. - ACCEPTS: matplotlib color arg or sequence of rgba tuples + Parameters + ---------- + c : color or sequence of rgba tuples .. seealso:: diff --git a/lib/matplotlib/table.py b/lib/matplotlib/table.py index cc5a27e2bfd9..885aa7b0cf06 100644 --- a/lib/matplotlib/table.py +++ b/lib/matplotlib/table.py @@ -497,9 +497,11 @@ def scale(self, xscale, yscale): def set_fontsize(self, size): """ - Set the fontsize of the cell text + Set the font size, in points, of the cell text. - ACCEPTS: a float in points + Parameters + ---------- + size : float """ for cell in self._cells.values(): diff --git a/lib/matplotlib/tests/test_artist.py b/lib/matplotlib/tests/test_artist.py index 75647666c7dc..c7a4b565c510 100644 --- a/lib/matplotlib/tests/test_artist.py +++ b/lib/matplotlib/tests/test_artist.py @@ -244,7 +244,7 @@ def test_setp(): # Check `file` argument sio = io.StringIO() plt.setp(lines1, 'zorder', file=sio) - assert sio.getvalue() == ' zorder: float \n' + assert sio.getvalue() == ' zorder: float\n' def test_None_zorder(): diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index bc78acc40cb4..477ea3eb6bef 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -245,11 +245,9 @@ def set_rotation_mode(self, m): """ Set text rotation mode. - .. ACCEPTS: [ None | "default" | "anchor" ] - Parameters ---------- - m : ``None`` or ``"default"`` or ``"anchor"`` + m : {None, 'default', 'anchor'} If ``None`` or ``"default"``, the text will be first rotated, then aligned according to their horizontal and vertical alignments. If ``"anchor"``, then alignment occurs before rotation. @@ -440,7 +438,9 @@ def set_bbox(self, rectprops): The default boxstyle is 'square'. The mutation scale of the FancyBboxPatch is set to the fontsize. - ACCEPTS: FancyBboxPatch prop dict + Parameters + ---------- + rectprops : FancyBboxPatch prop dict """ if rectprops is not None: @@ -534,7 +534,9 @@ def set_clip_box(self, clipbox): """ Set the artist's clip :class:`~matplotlib.transforms.Bbox`. - ACCEPTS: a :class:`matplotlib.transforms.Bbox` instance + Parameters + ---------- + clipbox : matplotlib.transforms.Bbox """ super().set_clip_box(clipbox) self._update_clip_properties() @@ -573,7 +575,6 @@ def set_clip_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ super().set_clip_on(b) self._update_clip_properties() @@ -588,7 +589,6 @@ def set_wrap(self, wrap): Parameters ---------- wrap : bool - .. ACCEPTS: bool """ self._wrap = wrap @@ -894,7 +894,9 @@ def set_backgroundcolor(self, color): :meth:`set_bbox` To change the position of the bounding box. - ACCEPTS: any matplotlib color + Parameters + ---------- + color : color """ if self._bbox_patch is None: self.set_bbox(dict(facecolor=color, edgecolor=color)) @@ -908,7 +910,9 @@ def set_color(self, color): """ Set the foreground color of the text - ACCEPTS: any matplotlib color + Parameters + ---------- + color : color """ # Make sure it is hashable, or get_prop_tup will fail. try: @@ -922,7 +926,9 @@ def set_horizontalalignment(self, align): """ Set the horizontal alignment to one of - ACCEPTS: [ 'center' | 'right' | 'left' ] + Parameters + ---------- + align : {'center', 'right', 'left'} """ legal = ('center', 'right', 'left') if align not in legal: @@ -938,7 +944,9 @@ def set_multialignment(self, align): and verticalalignment properties, but the multiline text within that box can be - ACCEPTS: ['left' | 'right' | 'center' ] + Parameters + ---------- + align: {'left', 'right', 'center'} """ legal = ('center', 'right', 'left') if align not in legal: @@ -952,7 +960,9 @@ def set_linespacing(self, spacing): Set the line spacing as a multiple of the font size. Default is 1.2. - ACCEPTS: float (multiple of font size) + Parameters + ---------- + spacing : float (multiple of font size) """ self._linespacing = spacing self.stale = True @@ -964,8 +974,10 @@ def set_family(self, fontname): name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams. - ACCEPTS: [FONTNAME | 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | - 'monospace' ] + Parameters + ---------- + fontname : {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', \ +'monospace'} """ self._fontproperties.set_family(fontname) self.stale = True @@ -974,7 +986,9 @@ def set_variant(self, variant): """ Set the font variant, either 'normal' or 'small-caps'. - ACCEPTS: [ 'normal' | 'small-caps' ] + Parameters + ---------- + variant : {'normal', 'small-caps'} """ self._fontproperties.set_variant(variant) self.stale = True @@ -983,7 +997,9 @@ def set_style(self, fontstyle): """ Set the font style. - ACCEPTS: [ 'normal' | 'italic' | 'oblique'] + Parameters + ---------- + fontstyle : {'normal', 'italic', 'oblique'} """ self._fontproperties.set_style(fontstyle) self.stale = True @@ -993,8 +1009,10 @@ def set_size(self, fontsize): Set the font size. May be either a size string, relative to the default font size, or an absolute font size in points. - ACCEPTS: [size in points | 'xx-small' | 'x-small' | 'small' | - 'medium' | 'large' | 'x-large' | 'xx-large' ] + Parameters + ---------- + fontsize : {size in points, 'xx-small', 'x-small', 'small', 'medium', \ +'large', 'x-large', 'xx-large'} """ self._fontproperties.set_size(fontsize) self.stale = True @@ -1003,10 +1021,11 @@ def set_weight(self, weight): """ Set the font weight. - ACCEPTS: [a numeric value in range 0-1000 | 'ultralight' | 'light' | - 'normal' | 'regular' | 'book' | 'medium' | 'roman' | - 'semibold' | 'demibold' | 'demi' | 'bold' | 'heavy' | - 'extra bold' | 'black' ] + Parameters + ---------- + weight : {a numeric value in range 0-1000, 'ultralight', 'light', \ +'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', \ +'demi', 'bold', 'heavy', 'extra bold', 'black'} """ self._fontproperties.set_weight(weight) self.stale = True @@ -1015,46 +1034,55 @@ def set_stretch(self, stretch): """ Set the font stretch (horizontal condensation or expansion). - ACCEPTS: [a numeric value in range 0-1000 | 'ultra-condensed' | - 'extra-condensed' | 'condensed' | 'semi-condensed' | - 'normal' | 'semi-expanded' | 'expanded' | 'extra-expanded' | - 'ultra-expanded' ] + Parameters + ---------- + stretch : {a numeric value in range 0-1000, 'ultra-condensed', \ +'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', \ +'expanded', 'extra-expanded', 'ultra-expanded'} """ self._fontproperties.set_stretch(stretch) self.stale = True def set_position(self, xy): """ - Set the (*x*, *y*) position of the text + Set the (*x*, *y*) position of the text. - ACCEPTS: (x,y) + Parameters + ---------- + xy : (float, float) """ self.set_x(xy[0]) self.set_y(xy[1]) def set_x(self, x): """ - Set the *x* position of the text + Set the *x* position of the text. - ACCEPTS: float + Parameters + ---------- + x : float """ self._x = x self.stale = True def set_y(self, y): """ - Set the *y* position of the text + Set the *y* position of the text. - ACCEPTS: float + Parameters + ---------- + y : float """ self._y = y self.stale = True def set_rotation(self, s): """ - Set the rotation of the text + Set the rotation of the text. - ACCEPTS: [ angle in degrees | 'vertical' | 'horizontal' ] + Parameters + ---------- + s : {angle in degrees, 'vertical', 'horizontal'} """ self._rotation = s self.stale = True @@ -1063,8 +1091,9 @@ def set_verticalalignment(self, align): """ Set the vertical alignment - ACCEPTS: [ 'center' | 'top' | 'bottom' | 'baseline' | - 'center_baseline' ] + Parameters + ---------- + align : {'center', 'top', 'bottom', 'baseline', 'center_baseline'} """ legal = ('top', 'bottom', 'center', 'baseline', 'center_baseline') if align not in legal: @@ -1080,8 +1109,9 @@ def set_text(self, s): It may contain newlines (``\\n``) or math in LaTeX syntax. - ACCEPTS: string or object castable to string, except - ``None``, which is set to an empty string. + Parameters + ---------- + s : string or object castable to string (but ``None`` becomes ``''``) """ if s is None: s = '' @@ -1117,7 +1147,9 @@ def set_fontproperties(self, fp): Set the font properties that control the text. *fp* must be a :class:`matplotlib.font_manager.FontProperties` object. - ACCEPTS: a :class:`matplotlib.font_manager.FontProperties` instance + Parameters + ---------- + fp : matplotlib.font_manager.FontProperties """ if isinstance(fp, str): fp = FontProperties(fp) @@ -1131,8 +1163,6 @@ def set_usetex(self, usetex): usetex : bool or None Whether to render using TeX, ``None`` means to use :rc:`text.usetex`. - - .. ACCEPTS: bool or None """ if usetex is None: self._usetex = rcParams['text.usetex'] @@ -1414,9 +1444,11 @@ def get_dashlength(self): def set_dashlength(self, dl): """ - Set the length of the dash. + Set the length of the dash, in canvas units. - ACCEPTS: float (canvas units) + Parameters + ---------- + dl : float """ self._dashlength = dl self.stale = True @@ -1429,12 +1461,13 @@ def get_dashdirection(self): def set_dashdirection(self, dd): """ - Set the direction of the dash following the text. - 1 is before the text and 0 is after. The default - is 0, which is what you'd want for the typical - case of ticks below and on the left of the figure. + Set the direction of the dash following the text. 1 is before the text + and 0 is after. The default is 0, which is what you'd want for the + typical case of ticks below and on the left of the figure. - ACCEPTS: int (1 is before, 0 is after) + Parameters + ---------- + dd : int (1 is before, 0 is after) """ self._dashdirection = dd self.stale = True @@ -1450,9 +1483,11 @@ def get_dashrotation(self): def set_dashrotation(self, dr): """ - Set the rotation of the dash, in degrees + Set the rotation of the dash, in degrees. - ACCEPTS: float (degrees) + Parameters + ---------- + dr : float """ self._dashrotation = dr self.stale = True @@ -1468,7 +1503,9 @@ def set_dashpad(self, dp): Set the "pad" of the TextWithDash, which is the extra spacing between the dash and the text, in canvas units. - ACCEPTS: float (canvas units) + Parameters + ---------- + dp : float """ self._dashpad = dp self.stale = True @@ -1482,11 +1519,12 @@ def get_dashpush(self): def set_dashpush(self, dp): """ - Set the "push" of the TextWithDash, which - is the extra spacing between the beginning - of the dash and the specified position. + Set the "push" of the TextWithDash, which is the extra spacing between + the beginning of the dash and the specified position. - ACCEPTS: float (canvas units) + Parameters + ---------- + dp : float """ self._dashpush = dp self.stale = True @@ -1495,7 +1533,9 @@ def set_position(self, xy): """ Set the (*x*, *y*) position of the :class:`TextWithDash`. - ACCEPTS: (x, y) + Parameters + ---------- + xy : (float, float) """ self.set_x(xy[0]) self.set_y(xy[1]) @@ -1504,7 +1544,9 @@ def set_x(self, x): """ Set the *x* position of the :class:`TextWithDash`. - ACCEPTS: float + Parameters + ---------- + x : float """ self._dashx = float(x) self.stale = True @@ -1513,7 +1555,9 @@ def set_y(self, y): """ Set the *y* position of the :class:`TextWithDash`. - ACCEPTS: float + Parameters + ---------- + y : float """ self._dashy = float(y) self.stale = True @@ -1523,7 +1567,9 @@ def set_transform(self, t): Set the :class:`matplotlib.transforms.Transform` instance used by this artist. - ACCEPTS: a :class:`matplotlib.transforms.Transform` instance + Parameters + ---------- + t : matplotlib.transforms.Transform """ Text.set_transform(self, t) self.dashline.set_transform(t) @@ -1535,9 +1581,11 @@ def get_figure(self): def set_figure(self, fig): """ - Set the figure instance the artist belong to. + Set the figure instance the artist belongs to. - ACCEPTS: a :class:`matplotlib.figure.Figure` instance + Parameters + ---------- + fig : matplotlib.figure.Figure """ Text.set_figure(self, fig) self.dashline.set_figure(fig) diff --git a/lib/mpl_toolkits/axisartist/axis_artist.py b/lib/mpl_toolkits/axisartist/axis_artist.py index 5ce41173442f..1ae2f7dbea01 100644 --- a/lib/mpl_toolkits/axisartist/axis_artist.py +++ b/lib/mpl_toolkits/axisartist/axis_artist.py @@ -901,13 +901,15 @@ def set_axis_direction(self, axis_direction): self.label.set_axis_direction(axis_direction) def set_ticklabel_direction(self, tick_direction): - """ + r""" Adjust the direction of the ticklabel. - ACCEPTS: [ "+" | "-" ] - - Note that the label_direction '+' and '-' are relative to the + Note that the *label_direction*\s '+' and '-' are relative to the direction of the increasing coordinate. + + Parameters + ---------- + tick_direction : {"+", "-"} """ if tick_direction not in ["+", "-"]: @@ -924,13 +926,15 @@ def invert_ticklabel_direction(self): self.minor_ticklabels.invert_axis_direction() def set_axislabel_direction(self, label_direction): - """ + r""" Adjust the direction of the axislabel. - ACCEPTS: [ "+" | "-" ] - - Note that the label_direction '+' and '-' are relative to the + Note that the *label_direction*\s '+' and '-' are relative to the direction of the increasing coordinate. + + Parameters + ---------- + tick_direction : {"+", "-"} """ if label_direction not in ["+", "-"]: raise ValueError('direction must be one of "+", "-"') diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py index 543e1b4c7a7d..7a669e46dac6 100644 --- a/lib/mpl_toolkits/mplot3d/art3d.py +++ b/lib/mpl_toolkits/mplot3d/art3d.py @@ -680,10 +680,11 @@ def set_edgecolor(self, colors): def set_alpha(self, alpha): """ - Set the alpha transparencies of the collection. *alpha* must be - a float or *None*. + Set the alpha transparencies of the collection. - .. ACCEPTS: float or None + Parameters + ---------- + alpha : float or None """ if alpha is not None: try: diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 87ac72ec94c6..16bb0ebec65e 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -346,7 +346,6 @@ def set_autoscale_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ super().set_autoscale_on(b) self.set_autoscalez_on(b) @@ -361,7 +360,6 @@ def set_autoscalez_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._autoscaleZon = b @@ -1281,7 +1279,6 @@ def set_frame_on(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._frameon = bool(b) self.stale = True @@ -1309,7 +1306,6 @@ def set_axisbelow(self, b): Parameters ---------- b : bool - .. ACCEPTS: bool """ self._axisbelow = True self.stale = True