-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Keep using a single dividers LineCollection instance in colorbar. #17834
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
Conversation
dividers : `.LineCollection` | ||
A LineCollection if *drawedges* is ``True``, otherwise ``None``. | ||
A LineCollection (empty if *drawedges* is ``False``). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get an API change note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is an API break because previously the attribute could be LineCollection or None, and now it's always LineCollection, so we don't add more types to handle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, people could have checked cb.dividers is None
, which now would have to be changed to not cb.dividers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, added changelog
This is a nice simplification. I don't find any test or example usage of the "drawedges" kwarg in any .py file in our repo. Searching for "drawedges" shows that it is also supported in axes_grid1/colorbar.py, which is deprecated as of 3.2. |
self.dividers = None | ||
self.dividers = collections.LineCollection( | ||
[], | ||
colors=[mpl.rcParams['axes.edgecolor']], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this change the time of rcParams
resolution from draw-time to init?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same "change in resolution time" occurred in #15981, where it is arguably a bugfix.
But sure, added to the changelog.
... updating its data as needed, instead of repeatedly deleting it and instantiating new ones.
... updating its data as needed, instead of repeatedly deleting it and
instantiating new ones.
Similar to #15981, just for another attribute.
PR Summary
PR Checklist