Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Figure property#4842
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Figure property#4842
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -9,7 +9,7 @@ | ||
import matplotlib | ||
import matplotlib.cbook as cbook | ||
from matplotlib.cbook import mplDeprecation | ||
from matplotlib import docstring, rcParams, deprecated_get_set | ||
from .transforms import (Bbox, IdentityTransform, TransformedBbox, | ||
TransformedPath, Transform) | ||
from .path import Path | ||
@@ -88,7 +88,7 @@ class Artist(object): | ||
def __init__(self): | ||
self._stale = True | ||
self._axes = None | ||
self._figure = None | ||
self._transform = None | ||
self._transformSet = False | ||
@@ -594,11 +594,26 @@ def set_path_effects(self, path_effects): | ||
def get_path_effects(self): | ||
return self._path_effects | ||
@property | ||
def figure(self): | ||
""":class:`~matplotlib.figure.Figure` instance the artist | ||
belongs to""" | ||
return self._figure | ||
@figure.setter | ||
def figure(self, fig): | ||
self._figure = fig | ||
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. If you are going to do this you should add validation that artists can not be moved between figures. | ||
if self._figure and self._figure is not self: | ||
self.add_callback(_stale_figure_callback) | ||
self.pchanged() | ||
self.stale = True | ||
def get_figure(self): | ||
""" | ||
Return the :class:`~matplotlib.figure.Figure` instance the | ||
artist belongs to. | ||
""" | ||
deprecated_get_set(self.__class__, self.get_figure, "figure") | ||
return self.figure | ||
def set_figure(self, fig): | ||
@@ -608,11 +623,8 @@ def set_figure(self, fig): | ||
ACCEPTS: a :class:`matplotlib.figure.Figure` instance | ||
""" | ||
deprecated_get_set(self.__class__, self.set_figure, "figure") | ||
self.figure = fig | ||
def set_clip_box(self, clipbox): | ||
""" | ||
Uh oh!
There was an error while loading.Please reload this page.