@@ -82,6 +82,9 @@ def contains(self, mouseevent):
8282 return inside , {}
8383
8484 def update_from (self , other ):
85+ """
86+ Updates this :class:`Patch` from the properties of *other*.
87+ """
8588 artist .Artist .update_from (self , other )
8689 self .set_edgecolor (other .get_edgecolor ())
8790 self .set_facecolor (other .get_facecolor ())
@@ -94,9 +97,17 @@ def update_from(self, other):
9497 self .set_alpha (other .get_alpha ())
9598
9699 def get_extents (self ):
100+ """
101+ Return a :class:`~matplotlib.transforms.Bbox` object defining
102+ the axis-aligned extents of the :class:`Patch`.
103+ """
97104 return self .get_path ().get_extents (self .get_transform ())
98105
99106 def get_transform (self ):
107+ """
108+ Return the :class:`~matplotlib.transforms.Transform` applied
109+ to the :class:`Patch`.
110+ """
100111 return self .get_patch_transform () + artist .Artist .get_transform (self )
101112
102113 def get_data_transform (self ):
@@ -106,22 +117,38 @@ def get_patch_transform(self):
106117 return transforms .IdentityTransform ()
107118
108119 def get_antialiased (self ):
120+ """
121+ Returns True if the :class:`Patch` is to be drawn with antialiasing.
122+ """
109123 return self ._antialiased
110124 get_aa = get_antialiased
111125
112126 def get_edgecolor (self ):
127+ """
128+ Return the edge color of the :class:`Patch`.
129+ """
113130 return self ._edgecolor
114131 get_ec = get_edgecolor
115132
116133 def get_facecolor (self ):
134+ """
135+ Return the face color of the :class:`Patch`.
136+ """
117137 return self ._facecolor
118138 get_fc = get_facecolor
119139
120140 def get_linewidth (self ):
141+ """
142+ Return the line width in points.
143+ """
121144 return self ._linewidth
122145 get_lw = get_linewidth
123146
124147 def get_linestyle (self ):
148+ """
149+ Return the linestyle. Will be one of ['solid' | 'dashed' |
150+ 'dashdot' | 'dotted']
151+ """
125152 return self ._linestyle
126153 get_ls = get_linestyle
127154
@@ -133,7 +160,10 @@ def set_antialiased(self, aa):
133160 """
134161 if aa is None : aa = mpl .rcParams ['patch.antialiased' ]
135162 self ._antialiased = aa
136- set_aa = set_antialiased
163+
164+ def set_aa (self , aa ):
165+ """alias for set_antialiased"""
166+ return self .set_antialiased (aa )
137167
138168 def set_edgecolor (self , color ):
139169 """
@@ -222,15 +252,18 @@ def set_hatch(self, h):
222252
223253 2. Hatching is done with solid black lines of width 0.
224254
255+
256+ ACCEPTS: [ '/' | '\\ ' | '|' | '-' | '#' | 'x' ]
225257 """
226258 self ._hatch = h
227259
228260 def get_hatch (self ):
229- 'return the current hatching pattern'
261+ 'Return the current hatching pattern'
230262 return self ._hatch
231263
232264
233265 def draw (self , renderer ):
266+ 'Draw the :class:`Patch` to the given *renderer*.'
234267 if not self .get_visible (): return
235268 #renderer.open_group('patch')
236269 gc = renderer .new_gc ()
@@ -378,8 +411,8 @@ def get_patch_transform(self):
378411
379412class Rectangle (Patch ):
380413 """
381- Draw a rectangle with lower left at *xy*= (*x*, *y*) with specified
382- width and height
414+ Draw a rectangle with lower left at *xy* = (*x*, *y*) with
415+ specified * width* and * height*.
383416 """
384417
385418 def __str__ (self ):
@@ -1296,13 +1329,11 @@ def draw_bbox(bbox, renderer, color='k', trans=None):
12961329
12971330class BboxTransmuterBase (object ):
12981331 """
1299- Bbox Transmuter Base class
1300-
1301- BBoxTransmuterBase and its derivatives are used to make a fancy box
1302- around a given rectangle. The __call__ method returns the Path of
1303- the fancy box. This class is not an artist and actual drawing of the
1304- fancy box is done by the :class:`FancyBboxPatch` class.
1305-
1332+ :class:`BBoxTransmuterBase` and its derivatives are used to make a
1333+ fancy box around a given rectangle. The :meth:`__call__` method
1334+ returns the :class:`~matplotlib.path.Path` of the fancy box. This
1335+ class is not an artist and actual drawing of the fancy box is done
1336+ by the :class:`FancyBboxPatch` class.
13061337 """
13071338
13081339 # The derived classes are required to be able to be initialized
@@ -1317,11 +1348,12 @@ def __init__(self):
13171348
13181349 def transmute (self , x0 , y0 , width , height , mutation_size ):
13191350 """
1320- The transmute method is a very core of the BboxTransmuter class
1321- and must be overriden in the subclasses. It receives the
1322- location and size of the rectangle, and the mutation_size, with
1323- which the amound padding and etc. will be scaled. It returns a
1324- Path instance.
1351+ The transmute method is a very core of the
1352+ :class:`BboxTransmuter` class and must be overriden in the
1353+ subclasses. It receives the location and size of the
1354+ rectangle, and the mutation_size, with which the amount of
1355+ padding and etc. will be scaled. It returns a
1356+ :class:`~matplotlib.path.Path` instance.
13251357 """
13261358 raise NotImplementedError ('Derived must override' )
13271359
@@ -1501,7 +1533,8 @@ def __init__(self, xy, width, height,
15011533 mutation_aspect = None ,
15021534 ** kwargs ):
15031535 """
1504- *xy*=lower left corner
1536+ *xy* = lower left corner
1537+
15051538 *width*, *height*
15061539
15071540 *boxstyle* describes how the fancy box will be drawn. It
@@ -1636,7 +1669,7 @@ def set_bbox_transmuter(self, bbox_transmuter):
16361669 """
16371670 Set the transmuter object
16381671
1639- ACCEPTS: BboxTransmuterBase (or its derivatives) instance
1672+ ACCEPTS: :class:` BboxTransmuterBase` (or its derivatives) instance
16401673 """
16411674 self ._bbox_transmuter = bbox_transmuter
16421675
0 commit comments