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
Add Axes.add_image() for consistency. #3061
Conversation
@@ -1457,6 +1457,17 @@ def add_collection(self, collection, autolim=True): | |||
collection._remove_method = lambda h: self.collections.remove(h) | |||
return collection | |||
|
|||
def add_line(self, image): |
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.
Woops.
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.
Woops indeed! 😑
This came about through a discussion on the linked cartopy PR, and I'm 👍 for the consistency that this PR brings. |
ret = im | ||
|
||
self._set_artist_props(ret) |
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.
Slight problem here... what if style=='quadmesh'? Its artist properties wouldn't get set in the axes (unless self.add_collection() already does that?)
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.
Yes - self.add_collection() already does a self._set_artist_props(collection)
. The fact that the add_* methods do that kind of thing (and can be kept consistent) is exactly why I'm keen to see add_image() exist.
I am also +1 on this in principle. There might be a couple subtle issues in pcolorfast(), but I doubt that they would be show-stopers. Definitely going to need CHANGELOG and whats_new.rst entries when done. |
""" | ||
self._set_artist_props(image) | ||
self.images.append(image) | ||
im._remove_method = lambda h: self.images.remove(h) |
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.
im doesn't exist.
Looks like the tests are basically OK now (half have passed and half have failed, but that seems to be to do with an indeterminate font issue that's also affecting other PRs). |
Add Axes.add_image() for consistency.
Thanks @rhattersley. |
No description provided.