@@ -353,7 +353,7 @@ def get_tightbbox(self, renderer=None):
353
353
354
354
Parameters
355
355
----------
356
- renderer : `. RendererBase` subclass
356
+ renderer : `~matplotlib.backend_bases. RendererBase` subclass, optional
357
357
renderer that will be used to draw the figures (i.e.
358
358
``fig.canvas.get_renderer()``)
359
359
@@ -440,7 +440,7 @@ def set_transform(self, t):
440
440
441
441
Parameters
442
442
----------
443
- t : `.Transform`
443
+ t : `~matplotlib.transforms .Transform`
444
444
"""
445
445
self ._transform = t
446
446
self ._transformSet = True
@@ -733,7 +733,7 @@ def set_figure(self, fig):
733
733
734
734
Parameters
735
735
----------
736
- fig : `.Figure`
736
+ fig : `~matplotlib.figure .Figure`
737
737
"""
738
738
# if this is a no-op just return
739
739
if self .figure is fig :
@@ -757,15 +757,16 @@ def set_clip_box(self, clipbox):
757
757
758
758
Parameters
759
759
----------
760
- clipbox : `.BboxBase ` or None
761
- Typically would be created from a `.TransformedBbox`. For
762
- instance ``TransformedBbox(Bbox([[0, 0], [1, 1]]), ax.transAxes)``
763
- is the default clipping for an artist added to an Axes.
760
+ clipbox : `~matplotlib.transforms.Bbox ` or None
761
+ Will typically be created from a `.TransformedBbox`. For instance,
762
+ ``TransformedBbox(Bbox([[0, 0], [1, 1]]), ax.transAxes)`` is the default
763
+ clipping for an artist added to an Axes.
764
764
765
765
"""
766
- self .clipbox = clipbox
767
- self .pchanged ()
768
- self .stale = True
766
+ if clipbox != self .clipbox :
767
+ self .clipbox = clipbox
768
+ self .pchanged ()
769
+ self .stale = True
769
770
770
771
def set_clip_path (self , path , transform = None ):
771
772
"""
@@ -986,7 +987,7 @@ def draw(self, renderer):
986
987
987
988
Parameters
988
989
----------
989
- renderer : `.RendererBase` subclass.
990
+ renderer : `~matplotlib.backend_bases .RendererBase` subclass.
990
991
991
992
Notes
992
993
-----
@@ -1010,9 +1011,10 @@ def set_alpha(self, alpha):
1010
1011
f'alpha must be numeric or None, not { type (alpha )} ' )
1011
1012
if alpha is not None and not (0 <= alpha <= 1 ):
1012
1013
raise ValueError (f'alpha ({ alpha } ) is outside 0-1 range' )
1013
- self ._alpha = alpha
1014
- self .pchanged ()
1015
- self .stale = True
1014
+ if alpha != self ._alpha :
1015
+ self ._alpha = alpha
1016
+ self .pchanged ()
1017
+ self .stale = True
1016
1018
1017
1019
def _set_alpha_for_array (self , alpha ):
1018
1020
"""
@@ -1045,9 +1047,10 @@ def set_visible(self, b):
1045
1047
----------
1046
1048
b : bool
1047
1049
"""
1048
- self ._visible = b
1049
- self .pchanged ()
1050
- self .stale = True
1050
+ if b != self ._visible :
1051
+ self ._visible = b
1052
+ self .pchanged ()
1053
+ self .stale = True
1051
1054
1052
1055
def set_animated (self , b ):
1053
1056
"""
@@ -1095,9 +1098,11 @@ def set_label(self, s):
1095
1098
s : object
1096
1099
*s* will be converted to a string by calling `str`.
1097
1100
"""
1098
- self ._label = str (s ) if s is not None else None
1099
- self .pchanged ()
1100
- self .stale = True
1101
+ label = str (s ) if s is not None else None
1102
+ if label != self ._label :
1103
+ self ._label = label
1104
+ self .pchanged ()
1105
+ self .stale = True
1101
1106
1102
1107
def get_zorder (self ):
1103
1108
"""Return the artist's zorder."""
@@ -1114,9 +1119,10 @@ def set_zorder(self, level):
1114
1119
"""
1115
1120
if level is None :
1116
1121
level = self .__class__ .zorder
1117
- self .zorder = level
1118
- self .pchanged ()
1119
- self .stale = True
1122
+ if level != self .zorder :
1123
+ self .zorder = level
1124
+ self .pchanged ()
1125
+ self .stale = True
1120
1126
1121
1127
@property
1122
1128
def sticky_edges (self ):
0 commit comments