| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| import matplotlib.text as mtext | ||
| import matplotlib.ticker as mticker | ||
| import matplotlib.transforms as mtransforms | ||
| import matplotlib.collections as mcollections |
There was a problem hiding this comment.
collections is already imported above.
Sorry, something went wrong.
| def _update_collection_limits(self, collection): | ||
| offsets = collection.get_offsets() | ||
| if offsets is not None and len(offsets): | ||
| self.update_datalim(offsets) |
There was a problem hiding this comment.
Very wrong indent, I don't know why linting isn't complaining.
This method also appears to be inserted into a completely random spot; I'd expect it to be located somewhere that parallels the other _update* methods.
Sorry, something went wrong.
| def test_relim_updates_scatter_offsets(): | ||
| import numpy as np | ||
| import matplotlib.pyplot as plt | ||
|
|
There was a problem hiding this comment.
Unnecessary imports.
Sorry, something went wrong.
There was a problem hiding this comment.
Please explain in detail what the code change does.
Sorry, something went wrong.
| mtransforms.blended_transform_factory( | ||
| self.xaxis.get_transform(), self.yaxis.get_transform())) | ||
|
|
||
| def _update_collection_limits(self, collection, autolim): |
There was a problem hiding this comment.
Why did you put the method in exactly this location?
This needs a docstring.
Sorry, something went wrong.
There was a problem hiding this comment.
okay I have shifted the _update_collection_limits after understanding other update function location .
Sorry, something went wrong.
2.Functionally, add_collection behaves the same as before for users. When autolim=True, the collection contributes its data limits to the axes and may trigger a view autoscale. 3.This change does not alter the behavior of relim(). Collections still expose their data limits via get_datalim, and relim() continues to query artists in the same way as before.
|
Sorry, something went wrong.
You've added collection._set_in_autoscale(autolim). This is a behavioral change to add_collection(). Please answer my questions in this regard: Is that the behavior we want/is that consistent with other add_* functions now? Should it? What are possible options for the behavior and their trade-offs.
Yes, please take it out. |
Sorry, something went wrong.
|
Thanks for the clarification — that makes sense. I will remove the call to collection._set_in_autoscale(autolim) from add_collection, so that adding a collection does not modify the Artist’s autoscale participation state. Instead, the Axes will respect the Artist’s existing autoscale flag when updating limits. I'll update the PR accordingly. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes conditional autoscaling behavior for Collections by using the
Artist autoscale participation flag introduced in PR1.
Previously, the autolim parameter in Axes.add_collection() did not
fully control whether a Collection participates in autoscaling.
This PR connects the autolim argument with the Artist autoscale
participation mechanism, ensuring that Collections are included or
excluded from autoscaling depending on the provided parameter.
Changes
from autoscaling
Related to discussion in PR #31128 .
Follow-up to maintainer suggestion by @timhoffm regarding conditional
autoscaling of Collections.