Repository navigation
Only do pchanged and set stale when value changes + doc consistency #26326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,7 +353,7 @@ def get_tightbbox(self, renderer=None): | |
|
|
||
| Parameters | ||
| ---------- | ||
| renderer : `.RendererBase` subclass | ||
| renderer : `~matplotlib.backend_bases.RendererBase` subclass, optional | ||
| renderer that will be used to draw the figures (i.e. | ||
| ``fig.canvas.get_renderer()``) | ||
|
|
||
|
|
@@ -440,7 +440,7 @@ def set_transform(self, t): | |
|
|
||
| Parameters | ||
| ---------- | ||
| t : `.Transform` | ||
| t : `~matplotlib.transforms.Transform` | ||
| """ | ||
| self._transform = t | ||
| self._transformSet = True | ||
|
|
@@ -733,7 +733,7 @@ def set_figure(self, fig): | |
|
|
||
| Parameters | ||
| ---------- | ||
| fig : `.Figure` | ||
| fig : `~matplotlib.figure.Figure` | ||
| """ | ||
| # if this is a no-op just return | ||
| if self.figure is fig: | ||
|
|
@@ -757,15 +757,16 @@ def set_clip_box(self, clipbox): | |
|
|
||
| Parameters | ||
| ---------- | ||
| clipbox : `.BboxBase` or None | ||
| Typically would be created from a `.TransformedBbox`. For | ||
| instance ``TransformedBbox(Bbox([[0, 0], [1, 1]]), ax.transAxes)`` | ||
| is the default clipping for an artist added to an Axes. | ||
| clipbox : `~matplotlib.transforms.Bbox` or None | ||
| Will typically be created from a `.TransformedBbox`. For instance, | ||
| ``TransformedBbox(Bbox([[0, 0], [1, 1]]), ax.transAxes)`` is the default | ||
| clipping for an artist added to an Axes. | ||
|
|
||
| """ | ||
| self.clipbox = clipbox | ||
| self.pchanged() | ||
| self.stale = True | ||
| if clipbox != self.clipbox: | ||
| self.clipbox = clipbox | ||
| self.pchanged() | ||
| self.stale = True | ||
|
|
||
| def set_clip_path(self, path, transform=None): | ||
| """ | ||
|
|
@@ -986,7 +987,7 @@ def draw(self, renderer): | |
|
|
||
| Parameters | ||
| ---------- | ||
| renderer : `.RendererBase` subclass. | ||
| renderer : `~matplotlib.backend_bases.RendererBase` subclass. | ||
|
|
||
| Notes | ||
| ----- | ||
|
|
@@ -1010,9 +1011,10 @@ def set_alpha(self, alpha): | |
| f'alpha must be numeric or None, not {type(alpha)}') | ||
| if alpha is not None and not (0 <= alpha <= 1): | ||
| raise ValueError(f'alpha ({alpha}) is outside 0-1 range') | ||
| self._alpha = alpha | ||
| self.pchanged() | ||
| self.stale = True | ||
| if alpha != self._alpha: | ||
| self._alpha = alpha | ||
| self.pchanged() | ||
| self.stale = True | ||
|
Comment on lines
+1016
to
+1017
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a follow-up PR I wonder if we should move
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That can for sure be a good idea. |
||
|
|
||
| def _set_alpha_for_array(self, alpha): | ||
| """ | ||
|
|
@@ -1045,9 +1047,10 @@ def set_visible(self, b): | |
| ---------- | ||
| b : bool | ||
| """ | ||
| self._visible = b | ||
| self.pchanged() | ||
| self.stale = True | ||
| if b != self._visible: | ||
| self._visible = b | ||
| self.pchanged() | ||
| self.stale = True | ||
|
|
||
| def set_animated(self, b): | ||
| """ | ||
|
|
@@ -1095,9 +1098,11 @@ def set_label(self, s): | |
| s : object | ||
| *s* will be converted to a string by calling `str`. | ||
| """ | ||
| self._label = str(s) if s is not None else None | ||
| self.pchanged() | ||
| self.stale = True | ||
| label = str(s) if s is not None else None | ||
| if label != self._label: | ||
| self._label = label | ||
| self.pchanged() | ||
| self.stale = True | ||
|
|
||
| def get_zorder(self): | ||
| """Return the artist's zorder.""" | ||
|
|
@@ -1114,9 +1119,10 @@ def set_zorder(self, level): | |
| """ | ||
| if level is None: | ||
| level = self.__class__.zorder | ||
| self.zorder = level | ||
| self.pchanged() | ||
| self.stale = True | ||
| if level != self.zorder: | ||
| self.zorder = level | ||
| self.pchanged() | ||
| self.stale = True | ||
|
|
||
| @property | ||
| def sticky_edges(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.