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