@@ -104,8 +104,8 @@ def register_backend(format, backend, description=None):
104
104
backend : module string or canvas class
105
105
Backend for handling file output
106
106
107
- description : str, optional
108
- Description of the file type. Defaults to an empty string
107
+ description : str, default: ""
108
+ Description of the file type.
109
109
"""
110
110
if description is None :
111
111
description = ''
@@ -461,14 +461,14 @@ def draw_image(self, gc, x, y, im, transform=None):
461
461
Parameters
462
462
----------
463
463
gc : `GraphicsContextBase`
464
- a graphics context with clipping information.
464
+ A graphics context with clipping information.
465
465
466
466
x : scalar
467
- the distance in physical units (i.e., dots or pixels) from the left
467
+ The distance in physical units (i.e., dots or pixels) from the left
468
468
hand side of the canvas.
469
469
470
470
y : scalar
471
- the distance in physical units (i.e., dots or pixels) from the
471
+ The distance in physical units (i.e., dots or pixels) from the
472
472
bottom side of the canvas.
473
473
474
474
im : array-like, shape=(N, M, 4), dtype=np.uint8
@@ -517,22 +517,22 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
517
517
----------
518
518
gc : `GraphicsContextBase`
519
519
The graphics context.
520
- x : scalar
520
+ x : float
521
521
The x location of the text in display coords.
522
- y : scalar
522
+ y : float
523
523
The y location of the text baseline in display coords.
524
524
s : str
525
525
The text string.
526
526
prop : `matplotlib.font_manager.FontProperties`
527
527
The font properties.
528
- angle : scalar
529
- The rotation angle in degrees.
528
+ angle : float
529
+ The rotation angle in degrees anti-clockwise .
530
530
mtext : `matplotlib.text.Text`
531
531
The original text object to be rendered.
532
532
533
533
Notes
534
534
-----
535
- **backend implementers note **
535
+ **Note for backend implementers: **
536
536
537
537
When you are trying to determine if you have gotten your bounding box
538
538
right (which is what enables the text layout/alignment to work
@@ -664,11 +664,11 @@ def points_to_pixels(self, points):
664
664
doesn't have a dpi, e.g., postscript or svg). Some imaging
665
665
systems assume some value for pixels per inch::
666
666
667
- points to pixels = points * pixels_per_inch/72.0 * dpi/72.0
667
+ points to pixels = points * pixels_per_inch/72 * dpi/72
668
668
669
669
Parameters
670
670
----------
671
- points : scalar or array-like
671
+ points : float or array-like
672
672
a float or a numpy array of float
673
673
674
674
Returns
@@ -1022,11 +1022,10 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
1022
1022
The amplitude of the wiggle perpendicular to the source line, in
1023
1023
pixels. If scale is `None`, or not provided, no sketch filter will
1024
1024
be provided.
1025
- length : float, optional
1026
- The length of the wiggle along the line, in pixels (default 128).
1027
- randomness : float, optional
1028
- The scale factor by which the length is shrunken or expanded
1029
- (default 16).
1025
+ length : float, default: 128
1026
+ The length of the wiggle along the line, in pixels.
1027
+ randomness : float, default: 16
1028
+ The scale factor by which the length is shrunken or expanded.
1030
1029
"""
1031
1030
self ._sketch = (
1032
1031
None if scale is None
@@ -1259,12 +1258,10 @@ class ResizeEvent(Event):
1259
1258
1260
1259
Attributes
1261
1260
----------
1262
- width : scalar
1263
- width of the canvas in pixels
1264
-
1265
- height : scalar
1266
- height of the canvas in pixels
1267
-
1261
+ width : int
1262
+ Width of the canvas in pixels.
1263
+ height : int
1264
+ Height of the canvas in pixels.
1268
1265
"""
1269
1266
def __init__ (self , name , canvas ):
1270
1267
Event .__init__ (self , name , canvas )
@@ -1287,20 +1284,16 @@ class LocationEvent(Event):
1287
1284
1288
1285
Attributes
1289
1286
----------
1290
- x : scalar
1291
- x position - pixels from left of canvas
1292
-
1293
- y : scalar
1294
- y position - pixels from bottom of canvas
1295
-
1296
- inaxes : bool
1297
- the :class:`~matplotlib.axes.Axes` instance if mouse is over axes
1298
-
1299
- xdata : scalar
1300
- x coord of mouse in data coords
1301
-
1302
- ydata : scalar
1303
- y coord of mouse in data coords
1287
+ x : int
1288
+ x position - pixels from left of canvas.
1289
+ y : int
1290
+ y position - pixels from bottom of canvas.
1291
+ inaxes : `~.axes.Axes` or None
1292
+ The `~.axes.Axes` instance over which the mouse is, if any.
1293
+ xdata : float or None
1294
+ x data coordinate of the mouse.
1295
+ ydata : float or None
1296
+ y data coordinate of the mouse.
1304
1297
"""
1305
1298
1306
1299
lastevent = None # the last event that was triggered before this one
@@ -1402,7 +1395,7 @@ class MouseEvent(LocationEvent):
1402
1395
The key pressed when the mouse event triggered, e.g. 'shift'.
1403
1396
See `KeyEvent`.
1404
1397
1405
- step : scalar
1398
+ step : int
1406
1399
The number of scroll steps (positive for 'up', negative for 'down').
1407
1400
This applies only to 'scroll_event' and defaults to 0 otherwise.
1408
1401
@@ -1989,29 +1982,31 @@ def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,
1989
1982
filename
1990
1983
can also be a file object on image backends
1991
1984
1992
- orientation : {'landscape', 'portrait'}, optional
1985
+ orientation : {'landscape', 'portrait'}, default: 'portrait'
1993
1986
only currently applies to PostScript printing.
1994
1987
1995
1988
dpi : scalar, optional
1996
1989
the dots per inch to save the figure in; if None, use savefig.dpi
1997
1990
1998
- facecolor : color or None, optional
1999
- the facecolor of the figure; if None, defaults to savefig.facecolor
1991
+ facecolor : color, default: :rc:`savefig.facecolor`
1992
+ The facecolor of the figure.
2000
1993
2001
- edgecolor : color or None, optional
2002
- the edgecolor of the figure; if None, defaults to savefig.edgecolor
1994
+ edgecolor : color, default: :rc:`savefig.edgecolor`
1995
+ The edgecolor of the figure.
2003
1996
2004
1997
format : str, optional
2005
- when set, forcibly set the file format to save to
1998
+ Force a specific file format. If not given, the format is inferred
1999
+ from the *filename* extension, and if that fails from
2000
+ :rc:`savefig.format`.
2006
2001
2007
- bbox_inches : str or `~matplotlib.transforms.Bbox`, optional
2002
+ bbox_inches : 'tight' or `~matplotlib.transforms.Bbox`, \
2003
+ default: :rc:`savefig.bbox`
2008
2004
Bbox in inches. Only the given portion of the figure is
2009
2005
saved. If 'tight', try to figure out the tight bbox of
2010
- the figure. If None, use savefig.bbox
2006
+ the figure.
2011
2007
2012
- pad_inches : scalar, optional
2013
- Amount of padding around the figure when bbox_inches is
2014
- 'tight'. If None, use savefig.pad_inches
2008
+ pad_inches : float, default: :rc:`savefig.pad_inches`
2009
+ Amount of padding around the figure when *bbox_inches* is 'tight'.
2015
2010
2016
2011
bbox_extra_artists : list of `~matplotlib.artist.Artist`, optional
2017
2012
A list of extra artists that will be considered when the
@@ -3400,9 +3395,9 @@ def mainloop(self):
3400
3395
3401
3396
class ShowBase (_Backend ):
3402
3397
"""
3403
- Simple base class to generate a show() callable in backends.
3398
+ Simple base class to generate a `` show()`` function in backends.
3404
3399
3405
- Subclass must override mainloop() method.
3400
+ Subclass must override `` mainloop()`` method.
3406
3401
"""
3407
3402
3408
3403
def __call__ (self , block = None ):
0 commit comments