@@ -307,9 +307,8 @@ def set_transform(self, t):
307
307
Parameters
308
308
----------
309
309
t : `~.Transform`
310
-
311
- ..
312
- ACCEPTS: `~.Transform`
310
+ ..
311
+ ACCEPTS: `~.Transform`
313
312
"""
314
313
self ._transform = t
315
314
self ._transformSet = True
@@ -377,7 +376,11 @@ def set_contains(self, picker):
377
376
and *props* is a dictionary of properties you want returned
378
377
with the contains test.
379
378
380
- ACCEPTS: a callable function
379
+ Parameters
380
+ ----------
381
+ picker : callable
382
+ ..
383
+ ACCEPTS: a callable function
381
384
"""
382
385
self ._contains = picker
383
386
@@ -454,46 +457,51 @@ def set_picker(self, picker):
454
457
artist, return *hit=True* and props is a dictionary of
455
458
properties you want added to the PickEvent attributes.
456
459
457
- ACCEPTS: [None|float|boolean|callable]
460
+ Parameters
461
+ ----------
462
+ picker : None or bool or float or callable
463
+ ..
464
+ ACCEPTS: [None | bool | float | callable]
458
465
"""
459
466
self ._picker = picker
460
467
461
468
def get_picker (self ):
462
- ' Return the picker object used by this artist'
469
+ """ Return the picker object used by this artist."""
463
470
return self ._picker
464
471
465
472
def is_figure_set (self ):
466
- """
467
- Returns True if the artist is assigned to a
468
- :class:`~matplotlib.figure.Figure`.
469
- """
473
+ """Returns whether the artist is assigned to a `~.Figure`."""
470
474
return self .figure is not None
471
475
472
476
def get_url (self ):
473
- """
474
- Returns the url
475
- """
477
+ """Returns the url."""
476
478
return self ._url
477
479
478
480
def set_url (self , url ):
479
481
"""
480
- Sets the url for the artist
482
+ Sets the url for the artist.
481
483
482
- ACCEPTS: a url string
484
+ Parameters
485
+ ----------
486
+ url : str
487
+ ..
488
+ ACCEPTS: a url string
483
489
"""
484
490
self ._url = url
485
491
486
492
def get_gid (self ):
487
- """
488
- Returns the group id
489
- """
493
+ """Returns the group id."""
490
494
return self ._gid
491
495
492
496
def set_gid (self , gid ):
493
497
"""
494
- Sets the (group) id for the artist
498
+ Sets the (group) id for the artist.
495
499
496
- ACCEPTS: an id string
500
+ Parameters
501
+ ----------
502
+ gid : str
503
+ ..
504
+ ACCEPTS: an id string
497
505
"""
498
506
self ._gid = gid
499
507
@@ -528,8 +536,11 @@ def set_snap(self, snap):
528
536
529
537
Only supported by the Agg and MacOSX backends.
530
538
531
- ..
532
- ACCEPTS: Optional[bool]
539
+ Parameters
540
+ ----------
541
+ snap : Optional[bool]
542
+ ..
543
+ ACCEPTS: Optional[bool]
533
544
"""
534
545
self ._snap = snap
535
546
self .stale = True
@@ -560,9 +571,6 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
560
571
"""
561
572
Sets the sketch parameters.
562
573
563
- ..
564
- ACCEPTS: (scale: float, length: float, randomness: float)
565
-
566
574
Parameters
567
575
----------
568
576
@@ -578,6 +586,9 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
578
586
randomness : float, optional
579
587
The scale factor by which the length is shrunken or
580
588
expanded (default 16.0)
589
+
590
+ ..
591
+ ACCEPTS: (scale: float, length: float, randomness: float)
581
592
"""
582
593
if scale is None :
583
594
self ._sketch = None
@@ -588,12 +599,11 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
588
599
def set_path_effects (self , path_effects ):
589
600
"""Set the path effects.
590
601
591
- ..
592
- ACCEPTS: `~.AbstractPathEffect`
593
-
594
602
Parameters
595
603
----------
596
604
path_effects : `~.AbstractPathEffect`
605
+ ..
606
+ ACCEPTS: `~.AbstractPathEffect`
597
607
"""
598
608
self ._path_effects = path_effects
599
609
self .stale = True
@@ -602,18 +612,18 @@ def get_path_effects(self):
602
612
return self ._path_effects
603
613
604
614
def get_figure (self ):
605
- """
606
- Return the :class:`~matplotlib.figure.Figure` instance the
607
- artist belongs to.
608
- """
615
+ """Return the `~.Figure` instance the artist belongs to."""
609
616
return self .figure
610
617
611
618
def set_figure (self , fig ):
612
619
"""
613
- Set the :class:`~matplotlib.figure.Figure` instance the artist
614
- belongs to.
620
+ Set the `~.Figure` instance the artist belongs to.
615
621
616
- ACCEPTS: a :class:`matplotlib.figure.Figure` instance
622
+ Parameters
623
+ ----------
624
+ fig : `~.Figure`
625
+ ..
626
+ ACCEPTS: a `~.Figure` instance
617
627
"""
618
628
# if this is a no-op just return
619
629
if self .figure is fig :
@@ -633,9 +643,13 @@ def set_figure(self, fig):
633
643
634
644
def set_clip_box (self , clipbox ):
635
645
"""
636
- Set the artist's clip :class:`~matplotlib.transforms .Bbox`.
646
+ Set the artist's clip `~ .Bbox`.
637
647
638
- ACCEPTS: a :class:`matplotlib.transforms.Bbox` instance
648
+ Parameters
649
+ ----------
650
+ clipbox : `~.Bbox`
651
+ ..
652
+ ACCEPTS: a `~.Bbox` instance
639
653
"""
640
654
self .clipbox = clipbox
641
655
self .pchanged ()
@@ -656,9 +670,7 @@ def set_clip_path(self, path, transform=None):
656
670
this method will set the clipping box to the corresponding rectangle
657
671
and set the clipping path to ``None``.
658
672
659
- ACCEPTS: [ (:class:`~matplotlib.path.Path`,
660
- :class:`~matplotlib.transforms.Transform`) |
661
- :class:`~matplotlib.patches.Patch` | None ]
673
+ ACCEPTS: [(`~matplotlib.path.Path`, `~.Transform`) | `~.Patch` | None]
662
674
"""
663
675
from matplotlib .patches import Patch , Rectangle
664
676
@@ -741,7 +753,11 @@ def set_clip_on(self, b):
741
753
When False artists will be visible out side of the axes which
742
754
can lead to unexpected results.
743
755
744
- ACCEPTS: [True | False]
756
+ Parameters
757
+ ----------
758
+ b : bool
759
+ ..
760
+ ACCEPTS: bool
745
761
"""
746
762
self ._clipon = b
747
763
# This may result in the callbacks being hit twice, but ensures they
@@ -760,7 +776,7 @@ def _set_gc_clip(self, gc):
760
776
gc .set_clip_path (None )
761
777
762
778
def get_rasterized (self ):
763
- "return True if the artist is to be rasterized"
779
+ """Return whether the artist is to be rasterized."" "
764
780
return self ._rasterized
765
781
766
782
def set_rasterized (self , rasterized ):
@@ -769,7 +785,11 @@ def set_rasterized(self, rasterized):
769
785
770
786
Defaults to None, which implies the backend's default behavior
771
787
772
- ACCEPTS: [True | False | None]
788
+ Parameters
789
+ ----------
790
+ rasterized : Optional[bool]
791
+ ..
792
+ ACCEPTS: [True | False | None]
773
793
"""
774
794
if rasterized and not hasattr (self .draw , "_supports_rasterization" ):
775
795
warnings .warn ("Rasterization of '%s' will be ignored" % self )
@@ -783,15 +803,15 @@ def get_agg_filter(self):
783
803
def set_agg_filter (self , filter_func ):
784
804
"""Set the agg filter.
785
805
786
- ..
787
- ACCEPTS: a filter function, which takes a (m, n, 3) float array and
788
- a dpi value, and returns a (m, n, 3) array
789
-
790
806
Parameters
791
807
----------
792
808
filter_func : callable
793
809
A filter function, which takes a (m, n, 3) float array and a dpi
794
810
value, and returns a (m, n, 3) array.
811
+
812
+ ..
813
+ ACCEPTS: a filter function, which takes a (m, n, 3) float array
814
+ and a dpi value, and returns a (m, n, 3) array
795
815
"""
796
816
self ._agg_filter = filter_func
797
817
self .stale = True
@@ -807,17 +827,25 @@ def set_alpha(self, alpha):
807
827
Set the alpha value used for blending - not supported on
808
828
all backends.
809
829
810
- ACCEPTS: float (0.0 transparent through 1.0 opaque)
830
+ Parameters
831
+ ----------
832
+ alpha : float
833
+ ..
834
+ ACCEPTS: float (0.0 transparent through 1.0 opaque)
811
835
"""
812
836
self ._alpha = alpha
813
837
self .pchanged ()
814
838
self .stale = True
815
839
816
840
def set_visible (self , b ):
817
841
"""
818
- Set the artist's visiblity .
842
+ Set the artist's visibility .
819
843
820
- ACCEPTS: [True | False]
844
+ Parameters
845
+ ----------
846
+ b : bool
847
+ ..
848
+ ACCEPTS: bool
821
849
"""
822
850
self ._visible = b
823
851
self .pchanged ()
@@ -827,26 +855,30 @@ def set_animated(self, b):
827
855
"""
828
856
Set the artist's animation state.
829
857
830
- ACCEPTS: [True | False]
858
+ Parameters
859
+ ----------
860
+ b : bool
861
+ ..
862
+ ACCEPTS: bool
831
863
"""
832
864
if self ._animated != b :
833
865
self ._animated = b
834
866
self .pchanged ()
835
867
836
868
def update (self , props ):
837
869
"""
838
- Update the properties of this :class:`Artist` from the
839
- dictionary *prop*.
870
+ Update this artist's properties from the dictionary *prop*.
840
871
"""
841
872
def _update_property (self , k , v ):
842
- """sorting out how to update property (setter or setattr)
873
+ """Sorting out how to update property (setter or setattr).
843
874
844
875
Parameters
845
876
----------
846
877
k : str
847
878
The name of property to update
848
879
v : obj
849
880
The value to assign to the property
881
+
850
882
Returns
851
883
-------
852
884
ret : obj or None
@@ -877,36 +909,42 @@ def _update_property(self, k, v):
877
909
return ret
878
910
879
911
def get_label (self ):
880
- """
881
- Get the label used for this artist in the legend.
882
- """
912
+ """Get the label used for this artist in the legend."""
883
913
return self ._label
884
914
885
915
def set_label (self , s ):
886
916
"""
887
917
Set the label to *s* for auto legend.
888
918
889
- ACCEPTS: string or anything printable with '%s' conversion.
919
+ Parameters
920
+ ----------
921
+ s : object
922
+ *s* will be converted to a string by calling `str`.
923
+
924
+ ..
925
+ ACCEPTS: object
890
926
"""
891
927
if s is not None :
892
- self ._label = '%s' % ( s , )
928
+ self ._label = str ( s )
893
929
else :
894
930
self ._label = None
895
931
self .pchanged ()
896
932
self .stale = True
897
933
898
934
def get_zorder (self ):
899
- """
900
- Return the :class:`Artist`'s zorder.
901
- """
935
+ """Return the artist's zorder."""
902
936
return self .zorder
903
937
904
938
def set_zorder (self , level ):
905
939
"""
906
940
Set the zorder for the artist. Artists with lower zorder
907
941
values are drawn first.
908
942
909
- ACCEPTS: any number
943
+ Parameters
944
+ ----------
945
+ level : float
946
+ ..
947
+ ACCEPTS: float
910
948
"""
911
949
self .zorder = level
912
950
self .pchanged ()
0 commit comments