Skip to content
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

Merged
merged 3 commits into from May 15, 2014
Merged

Conversation

rhattersley
Copy link
Contributor

No description provided.

@@ -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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops indeed! 😑

@pelson
Copy link
Member

pelson commented May 14, 2014

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)
Copy link
Member

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?)

Copy link
Contributor Author

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.

@WeatherGod
Copy link
Member

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.

@tacaswell tacaswell added this to the v1.4.0 milestone May 14, 2014
"""
self._set_artist_props(image)
self.images.append(image)
im._remove_method = lambda h: self.images.remove(h)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im doesn't exist.

@rhattersley
Copy link
Contributor Author

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).

pelson added a commit that referenced this pull request May 15, 2014
Add Axes.add_image() for consistency.
@pelson pelson merged commit 4a54114 into matplotlib:master May 15, 2014
@pelson
Copy link
Member

pelson commented May 15, 2014

Thanks @rhattersley.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants