-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecated the set_colorbar method on a scalar mappable. #2055
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
'set the colorbar image and axes associated with mappable' | ||
self.colorbar = im, ax | ||
"""set the colorbar and axes instances associated with mappable""" | ||
self.colorbar = im |
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 must have missed some other PR... there weren't any old code that would have queried and expected a tuple from the colorbar attribute, right?
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.
No. I don't think anything is making use of it (at least, there are no tests which exercise it, and a thorough grepping didn't throw anything up)
It looks like part of the point here is that a colorbar always has an axes attribute, so there is no need for a tuple in the ScalarMappable colorbar attribute. Looks like a good cleanup--but it is a bit dangerous, and I don't know how to handle that. The danger, of course, is that some user code is expecting the attribute to hold a tuple. Maybe it will be adequate to simply flag this prominently in the description of API changes. |
Agreed. Indeed I have code which does |
Think this is good to go. |
Deprecated the set_colorbar method on a scalar mappable.
of ``(colorbar_instance, colorbar_axes)`` but is now just | ||
``colorbar_instance``. To get the colorbar axes it is possible to just use | ||
the :attr:`~matplotlib.colorbar.ColorbarBase.ax` attribute on a colorbar | ||
isntance. |
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.
Ah. Sorry - typo.
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.
No worries. We can just push that fix directly to master.
As a note, since this is a backwards incompatible change, should the next version number be |
Since 1.0, we have allowed backward incompatible changes of this magnitude for minor point releases, with a note in |
Deprecated in matplotlib#2055 / 148ed82
Deprecated in matplotlib#2055 / 148ed82
Deprecated in matplotlib#2055 / 148ed82
Deprecated in matplotlib#2055 / 148ed82
Deprecated in matplotlib#2055 / 148ed82
No description provided.