-
-
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
Changes from all commits
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 |
---|---|---|
|
@@ -193,12 +193,14 @@ def __init__(self, norm=None, cmap=None): | |
self.norm = norm | ||
#: The Colormap instance of this ScalarMappable. | ||
self.cmap = get_cmap(cmap) | ||
#: The last colorbar associated with this ScalarMappable. May be None. | ||
self.colorbar = None | ||
self.update_dict = {'array': False} | ||
|
||
@cbook.deprecated('1.3', alternative='the colorbar attribute') | ||
def set_colorbar(self, im, ax): | ||
'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 commentThe 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 commentThe 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) |
||
|
||
def to_rgba(self, x, alpha=None, bytes=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.
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.