-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add private Artist-level autoscale participation flag #31166
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 all commits
529d37c
defd13e
fbb623e
5bf5273
7247fa5
b527465
0ad2c0a
6c702b6
bcf2fc2
31f59f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,6 +225,7 @@ def __init__(self): | |
| self._path_effects = mpl.rcParams['path.effects'] | ||
| self._sticky_edges = _XYPair([], []) | ||
| self._in_layout = True | ||
| self._in_autoscale = False | ||
|
|
||
| def __getstate__(self): | ||
| d = self.__dict__.copy() | ||
|
|
@@ -903,6 +904,14 @@ def get_in_layout(self): | |
| """ | ||
| return self._in_layout | ||
|
|
||
| def _get_in_autoscale(self): | ||
| """ | ||
| Return whether the artist is included in autoscaling calculations. | ||
|
|
||
| E.g. `.axes.Axes.autoscale_view()`. | ||
| """ | ||
| return self._in_autoscale | ||
|
|
||
| def _fully_clipped_to_axes(self): | ||
| """ | ||
| Return a boolean flag, ``True`` if the artist is clipped to the Axes | ||
|
|
@@ -1132,6 +1141,17 @@ def set_in_layout(self, in_layout): | |
| """ | ||
| self._in_layout = in_layout | ||
|
|
||
| def _set_in_autoscale(self, b): | ||
| """ | ||
| Set if artist is to be included in autoscaling calculations, | ||
| E.g. `.axes.Axes.autoscale_view()`. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| b : bool | ||
| """ | ||
| self._in_autoscale = b | ||
|
Member
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. To be checked: Do we need to set the
Contributor
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. I don’t think _set_in_autoscale should mark the artist as stale. The flag only affects whether the artist participates in future autoscaling; it doesn’t change the artist’s visual state or require a redraw on its own. In practice it’s set during add_*, before any drawing occurs, so marking it stale would be unnecessary.
Member
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. Ok, so the argument is that changing in_autoscale will not result in automatic recalculation of the limits. Accepted. Can you please add a sentence on this to the docstring. |
||
|
|
||
| def get_label(self): | ||
| """Return the label used for this artist in the legend.""" | ||
| return self._label | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.