@@ -302,10 +302,13 @@ def is_transform_set(self):
302
302
303
303
def set_transform (self , t ):
304
304
"""
305
- Set the :class:`~matplotlib.transforms.Transform` instance
306
- used by this artist.
305
+ Set the artist transform.
307
306
308
- ACCEPTS: :class:`~matplotlib.transforms.Transform` instance
307
+ Parameters
308
+ ----------
309
+ t : `~.Transform`
310
+ ..
311
+ ACCEPTS: `~.Transform`
309
312
"""
310
313
self ._transform = t
311
314
self ._transformSet = True
@@ -373,7 +376,11 @@ def set_contains(self, picker):
373
376
and *props* is a dictionary of properties you want returned
374
377
with the contains test.
375
378
376
- ACCEPTS: a callable function
379
+ Parameters
380
+ ----------
381
+ picker : callable
382
+ ..
383
+ ACCEPTS: a callable function
377
384
"""
378
385
self ._contains = picker
379
386
@@ -450,46 +457,51 @@ def set_picker(self, picker):
450
457
artist, return *hit=True* and props is a dictionary of
451
458
properties you want added to the PickEvent attributes.
452
459
453
- ACCEPTS: [None|float|boolean|callable]
460
+ Parameters
461
+ ----------
462
+ picker : None or bool or float or callable
463
+ ..
464
+ ACCEPTS: [None | bool | float | callable]
454
465
"""
455
466
self ._picker = picker
456
467
457
468
def get_picker (self ):
458
- ' Return the picker object used by this artist'
469
+ """ Return the picker object used by this artist."""
459
470
return self ._picker
460
471
461
472
def is_figure_set (self ):
462
- """
463
- Returns True if the artist is assigned to a
464
- :class:`~matplotlib.figure.Figure`.
465
- """
473
+ """Returns whether the artist is assigned to a `~.Figure`."""
466
474
return self .figure is not None
467
475
468
476
def get_url (self ):
469
- """
470
- Returns the url
471
- """
477
+ """Returns the url."""
472
478
return self ._url
473
479
474
480
def set_url (self , url ):
475
481
"""
476
- Sets the url for the artist
482
+ Sets the url for the artist.
477
483
478
- ACCEPTS: a url string
484
+ Parameters
485
+ ----------
486
+ url : str
487
+ ..
488
+ ACCEPTS: a url string
479
489
"""
480
490
self ._url = url
481
491
482
492
def get_gid (self ):
483
- """
484
- Returns the group id
485
- """
493
+ """Returns the group id."""
486
494
return self ._gid
487
495
488
496
def set_gid (self , gid ):
489
497
"""
490
- Sets the (group) id for the artist
498
+ Sets the (group) id for the artist.
491
499
492
- ACCEPTS: an id string
500
+ Parameters
501
+ ----------
502
+ gid : str
503
+ ..
504
+ ACCEPTS: an id string
493
505
"""
494
506
self ._gid = gid
495
507
@@ -523,6 +535,12 @@ def set_snap(self, snap):
523
535
segments, round to the nearest pixel center
524
536
525
537
Only supported by the Agg and MacOSX backends.
538
+
539
+ Parameters
540
+ ----------
541
+ snap : bool or None
542
+ ..
543
+ ACCEPTS: bool or None
526
544
"""
527
545
self ._snap = snap
528
546
self .stale = True
@@ -568,6 +586,9 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
568
586
randomness : float, optional
569
587
The scale factor by which the length is shrunken or
570
588
expanded (default 16.0)
589
+
590
+ ..
591
+ ACCEPTS: (scale: float, length: float, randomness: float)
571
592
"""
572
593
if scale is None :
573
594
self ._sketch = None
@@ -576,9 +597,13 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
576
597
self .stale = True
577
598
578
599
def set_path_effects (self , path_effects ):
579
- """
580
- set path_effects, which should be a list of instances of
581
- matplotlib.patheffect._Base class or its derivatives.
600
+ """Set the path effects.
601
+
602
+ Parameters
603
+ ----------
604
+ path_effects : `~.AbstractPathEffect`
605
+ ..
606
+ ACCEPTS: `~.AbstractPathEffect`
582
607
"""
583
608
self ._path_effects = path_effects
584
609
self .stale = True
@@ -587,18 +612,18 @@ def get_path_effects(self):
587
612
return self ._path_effects
588
613
589
614
def get_figure (self ):
590
- """
591
- Return the :class:`~matplotlib.figure.Figure` instance the
592
- artist belongs to.
593
- """
615
+ """Return the `~.Figure` instance the artist belongs to."""
594
616
return self .figure
595
617
596
618
def set_figure (self , fig ):
597
619
"""
598
- Set the :class:`~matplotlib.figure.Figure` instance the artist
599
- belongs to.
620
+ Set the `~.Figure` instance the artist belongs to.
600
621
601
- ACCEPTS: a :class:`matplotlib.figure.Figure` instance
622
+ Parameters
623
+ ----------
624
+ fig : `~.Figure`
625
+ ..
626
+ ACCEPTS: a `~.Figure` instance
602
627
"""
603
628
# if this is a no-op just return
604
629
if self .figure is fig :
@@ -618,9 +643,13 @@ def set_figure(self, fig):
618
643
619
644
def set_clip_box (self , clipbox ):
620
645
"""
621
- Set the artist's clip :class:`~matplotlib.transforms .Bbox`.
646
+ Set the artist's clip `~ .Bbox`.
622
647
623
- ACCEPTS: a :class:`matplotlib.transforms.Bbox` instance
648
+ Parameters
649
+ ----------
650
+ clipbox : `~.Bbox`
651
+ ..
652
+ ACCEPTS: a `~.Bbox` instance
624
653
"""
625
654
self .clipbox = clipbox
626
655
self .pchanged ()
@@ -641,9 +670,7 @@ def set_clip_path(self, path, transform=None):
641
670
this method will set the clipping box to the corresponding rectangle
642
671
and set the clipping path to ``None``.
643
672
644
- ACCEPTS: [ (:class:`~matplotlib.path.Path`,
645
- :class:`~matplotlib.transforms.Transform`) |
646
- :class:`~matplotlib.patches.Patch` | None ]
673
+ ACCEPTS: [(`~matplotlib.path.Path`, `~.Transform`) | `~.Patch` | None]
647
674
"""
648
675
from matplotlib .patches import Patch , Rectangle
649
676
@@ -726,7 +753,11 @@ def set_clip_on(self, b):
726
753
When False artists will be visible out side of the axes which
727
754
can lead to unexpected results.
728
755
729
- ACCEPTS: [True | False]
756
+ Parameters
757
+ ----------
758
+ b : bool
759
+ ..
760
+ ACCEPTS: bool
730
761
"""
731
762
self ._clipon = b
732
763
# This may result in the callbacks being hit twice, but ensures they
@@ -745,30 +776,42 @@ def _set_gc_clip(self, gc):
745
776
gc .set_clip_path (None )
746
777
747
778
def get_rasterized (self ):
748
- "return True if the artist is to be rasterized"
779
+ """Return whether the artist is to be rasterized."" "
749
780
return self ._rasterized
750
781
751
782
def set_rasterized (self , rasterized ):
752
783
"""
753
784
Force rasterized (bitmap) drawing in vector backend output.
754
785
755
- Defaults to None, which implies the backend's default behavior
786
+ Defaults to None, which implies the backend's default behavior.
756
787
757
- ACCEPTS: [True | False | None]
788
+ Parameters
789
+ ----------
790
+ rasterized : bool or None
791
+ ..
792
+ ACCEPTS: bool or None
758
793
"""
759
794
if rasterized and not hasattr (self .draw , "_supports_rasterization" ):
760
795
warnings .warn ("Rasterization of '%s' will be ignored" % self )
761
796
762
797
self ._rasterized = rasterized
763
798
764
799
def get_agg_filter (self ):
765
- "return filter function to be used for agg filter"
800
+ """Return filter function to be used for agg filter."" "
766
801
return self ._agg_filter
767
802
768
803
def set_agg_filter (self , filter_func ):
769
- """
770
- set agg_filter function.
804
+ """Set the agg filter.
805
+
806
+ Parameters
807
+ ----------
808
+ filter_func : callable
809
+ A filter function, which takes a (m, n, 3) float array and a dpi
810
+ value, and returns a (m, n, 3) array.
771
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
772
815
"""
773
816
self ._agg_filter = filter_func
774
817
self .stale = True
@@ -784,17 +827,25 @@ def set_alpha(self, alpha):
784
827
Set the alpha value used for blending - not supported on
785
828
all backends.
786
829
787
- 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)
788
835
"""
789
836
self ._alpha = alpha
790
837
self .pchanged ()
791
838
self .stale = True
792
839
793
840
def set_visible (self , b ):
794
841
"""
795
- Set the artist's visiblity .
842
+ Set the artist's visibility .
796
843
797
- ACCEPTS: [True | False]
844
+ Parameters
845
+ ----------
846
+ b : bool
847
+ ..
848
+ ACCEPTS: bool
798
849
"""
799
850
self ._visible = b
800
851
self .pchanged ()
@@ -804,26 +855,30 @@ def set_animated(self, b):
804
855
"""
805
856
Set the artist's animation state.
806
857
807
- ACCEPTS: [True | False]
858
+ Parameters
859
+ ----------
860
+ b : bool
861
+ ..
862
+ ACCEPTS: bool
808
863
"""
809
864
if self ._animated != b :
810
865
self ._animated = b
811
866
self .pchanged ()
812
867
813
868
def update (self , props ):
814
869
"""
815
- Update the properties of this :class:`Artist` from the
816
- dictionary *prop*.
870
+ Update this artist's properties from the dictionary *prop*.
817
871
"""
818
872
def _update_property (self , k , v ):
819
- """sorting out how to update property (setter or setattr)
873
+ """Sorting out how to update property (setter or setattr).
820
874
821
875
Parameters
822
876
----------
823
877
k : str
824
878
The name of property to update
825
879
v : obj
826
880
The value to assign to the property
881
+
827
882
Returns
828
883
-------
829
884
ret : obj or None
@@ -854,36 +909,43 @@ def _update_property(self, k, v):
854
909
return ret
855
910
856
911
def get_label (self ):
857
- """
858
- Get the label used for this artist in the legend.
859
- """
912
+ """Get the label used for this artist in the legend."""
860
913
return self ._label
861
914
862
915
def set_label (self , s ):
863
916
"""
864
917
Set the label to *s* for auto legend.
865
918
866
- 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` (`unicode` on
923
+ Py2).
924
+
925
+ ..
926
+ ACCEPTS: object
867
927
"""
868
928
if s is not None :
869
- self ._label = '%s' % ( s , )
929
+ self ._label = six . text_type ( s )
870
930
else :
871
931
self ._label = None
872
932
self .pchanged ()
873
933
self .stale = True
874
934
875
935
def get_zorder (self ):
876
- """
877
- Return the :class:`Artist`'s zorder.
878
- """
936
+ """Return the artist's zorder."""
879
937
return self .zorder
880
938
881
939
def set_zorder (self , level ):
882
940
"""
883
941
Set the zorder for the artist. Artists with lower zorder
884
942
values are drawn first.
885
943
886
- ACCEPTS: any number
944
+ Parameters
945
+ ----------
946
+ level : float
947
+ ..
948
+ ACCEPTS: float
887
949
"""
888
950
if level is None :
889
951
level = self .__class__ .zorder
0 commit comments