@@ -97,7 +97,7 @@ def __init__(self,
97
97
98
98
def get_verts (self ):
99
99
"""
100
- Return a copy of the vertices used in this patch
100
+ Return a copy of the vertices used in this patch.
101
101
102
102
If the patch contains Bezier curves, the curves will be
103
103
interpolated by line segments. To access the curves as
@@ -230,9 +230,7 @@ def contains_points(self, points, radius=None):
230
230
radius )
231
231
232
232
def update_from (self , other ):
233
- """
234
- Updates this :class:`Patch` from the properties of *other*.
235
- """
233
+ """Updates this `.Patch` from the properties of *other*."""
236
234
artist .Artist .update_from (self , other )
237
235
# For some properties we don't need or don't want to go through the
238
236
# getters/setters, so we just copy them directly.
@@ -280,33 +278,23 @@ def get_patch_transform(self):
280
278
return transforms .IdentityTransform ()
281
279
282
280
def get_antialiased (self ):
283
- """
284
- Returns True if the :class:`Patch` is to be drawn with antialiasing.
285
- """
281
+ """Return whether antialiasing is used for drawing."""
286
282
return self ._antialiased
287
283
288
284
def get_edgecolor (self ):
289
- """
290
- Return the edge color of the :class:`Patch`.
291
- """
285
+ """Return the edge color."""
292
286
return self ._edgecolor
293
287
294
288
def get_facecolor (self ):
295
- """
296
- Return the face color of the :class:`Patch`.
297
- """
289
+ """Return the face color."""
298
290
return self ._facecolor
299
291
300
292
def get_linewidth (self ):
301
- """
302
- Return the line width in points.
303
- """
293
+ """Return the line width in points."""
304
294
return self ._linewidth
305
295
306
296
def get_linestyle (self ):
307
- """
308
- Return the linestyle.
309
- """
297
+ """Return the linestyle."""
310
298
return self ._linestyle
311
299
312
300
def set_antialiased (self , aa ):
@@ -467,7 +455,7 @@ def get_fill(self):
467
455
468
456
def set_capstyle (self , s ):
469
457
"""
470
- Set the patch capstyle
458
+ Set the capstyle.
471
459
472
460
Parameters
473
461
----------
@@ -479,12 +467,11 @@ def set_capstyle(self, s):
479
467
self .stale = True
480
468
481
469
def get_capstyle (self ):
482
- "Return the current capstyle"
470
+ """ Return the capstyle."" "
483
471
return self ._capstyle
484
472
485
473
def set_joinstyle (self , s ):
486
- """
487
- Set the patch joinstyle
474
+ """Set the joinstyle.
488
475
489
476
Parameters
490
477
----------
@@ -496,12 +483,12 @@ def set_joinstyle(self, s):
496
483
self .stale = True
497
484
498
485
def get_joinstyle (self ):
499
- "Return the current joinstyle"
486
+ """ Return the joinstyle."" "
500
487
return self ._joinstyle
501
488
502
489
def set_hatch (self , hatch ):
503
490
r"""
504
- Set the hatching pattern
491
+ Set the hatching pattern.
505
492
506
493
*hatch* can be one of::
507
494
@@ -531,7 +518,7 @@ def set_hatch(self, hatch):
531
518
self .stale = True
532
519
533
520
def get_hatch (self ):
534
- ' Return the current hatching pattern'
521
+ """ Return the hatching pattern."""
535
522
return self ._hatch
536
523
537
524
@contextlib .contextmanager
@@ -595,7 +582,7 @@ def _bind_draw_path_function(self, renderer):
595
582
596
583
@artist .allow_rasterization
597
584
def draw (self , renderer ):
598
- ' Draw the :class:`Patch` to the given *renderer*.'
585
+ """ Draw to the given *renderer*."""
599
586
if not self .get_visible ():
600
587
return
601
588
@@ -613,21 +600,17 @@ def draw(self, renderer):
613
600
self ._facecolor if self ._facecolor [3 ] else None )
614
601
615
602
def get_path (self ):
616
- """
617
- Return the path of this patch
618
- """
603
+ """Return the path of this patch."""
619
604
raise NotImplementedError ('Derived must override' )
620
605
621
606
def get_window_extent (self , renderer = None ):
622
607
return self .get_path ().get_extents (self .get_transform ())
623
608
624
609
def _convert_xy_units (self , xy ):
625
- """
626
- Convert x and y units for a tuple (x, y)
627
- """
610
+ """Convert x and y units for a tuple (x, y)."""
628
611
x = self .convert_xunits (xy [0 ])
629
612
y = self .convert_yunits (xy [1 ])
630
- return ( x , y )
613
+ return x , y
631
614
632
615
633
616
patchdoc = artist .kwdoc (Patch )
@@ -755,9 +738,7 @@ def __init__(self, xy, width, height, angle=0.0, **kwargs):
755
738
self ._rect_transform = transforms .IdentityTransform ()
756
739
757
740
def get_path (self ):
758
- """
759
- Return the vertices of the rectangle.
760
- """
741
+ """Return the vertices of the rectangle."""
761
742
return Path .unit_rectangle ()
762
743
763
744
def _update_patch_transform (self ):
@@ -783,9 +764,7 @@ def _update_y1(self):
783
764
self ._y1 = self ._y0 + self ._height
784
765
785
766
def _convert_units (self ):
786
- """
787
- Convert bounds of the rectangle.
788
- """
767
+ """Convert bounds of the rectangle."""
789
768
x0 = self .convert_xunits (self ._x0 )
790
769
y0 = self .convert_yunits (self ._y0 )
791
770
x1 = self .convert_xunits (self ._x1 )
@@ -797,40 +776,40 @@ def get_patch_transform(self):
797
776
return self ._rect_transform
798
777
799
778
def get_x (self ):
800
- "Return the left coord of the rectangle."
779
+ """ Return the left coordinate of the rectangle."" "
801
780
return self ._x0
802
781
803
782
def get_y (self ):
804
- "Return the bottom coord of the rectangle."
783
+ """ Return the bottom coordinate of the rectangle."" "
805
784
return self ._y0
806
785
807
786
def get_xy (self ):
808
- "Return the left and bottom coords of the rectangle. "
787
+ """ Return the left and bottom coords of the rectangle as a tuple."" "
809
788
return self ._x0 , self ._y0
810
789
811
790
def get_width (self ):
812
- "Return the width of the rectangle."
791
+ """ Return the width of the rectangle."" "
813
792
return self ._width
814
793
815
794
def get_height (self ):
816
- "Return the height of the rectangle."
795
+ """ Return the height of the rectangle."" "
817
796
return self ._height
818
797
819
798
def set_x (self , x ):
820
- "Set the left coord of the rectangle."
799
+ """ Set the left coordinate of the rectangle."" "
821
800
self ._x0 = x
822
801
self ._update_x1 ()
823
802
self .stale = True
824
803
825
804
def set_y (self , y ):
826
- "Set the bottom coord of the rectangle."
805
+ """ Set the bottom coordinate of the rectangle."" "
827
806
self ._y0 = y
828
807
self ._update_y1 ()
829
808
self .stale = True
830
809
831
810
def set_xy (self , xy ):
832
811
"""
833
- Set the left and bottom coords of the rectangle.
812
+ Set the left and bottom coordinates of the rectangle.
834
813
835
814
Parameters
836
815
----------
@@ -877,6 +856,7 @@ def set_bounds(self, *args):
877
856
self .stale = True
878
857
879
858
def get_bbox (self ):
859
+ """Return the `.Bbox`."""
880
860
x0 , y0 , x1 , y1 = self ._convert_units ()
881
861
return transforms .Bbox .from_extents (x0 , y0 , x1 , y1 )
882
862
@@ -2634,7 +2614,7 @@ def set_bounds(self, *args):
2634
2614
self .stale = True
2635
2615
2636
2616
def get_bbox (self ):
2637
- """Return the `.Bbox` of the rectangle ."""
2617
+ """Return the `.Bbox`."""
2638
2618
return transforms .Bbox .from_bounds (self ._x , self ._y ,
2639
2619
self ._width , self ._height )
2640
2620
0 commit comments