Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@dstansby
Copy link
Member

@dstansby dstansby commented Feb 2, 2021

Fixes #19432.

The behaviour before this patch was to return an existing Axes if it had the same subplot-spec, regardless of **kwargs. This changes that to always create a new Axes, which is what is documented and expected from the deprecation.

@dstansby dstansby added this to the v3.4.0 milestone Feb 2, 2021
@dstansby
Copy link
Member Author

dstansby commented Feb 2, 2021

Woops, looks like I missed #18978 (comment), ie.

plt.subplot(222)
plt.subplot(222)

should return the same axes, so this is going to need a bit more thought.

@dstansby dstansby marked this pull request as draft February 2, 2021 14:24
@dstansby dstansby closed this Feb 2, 2021
@astrofrog
Copy link
Contributor

Can't the behavior be that the same axes are returned assuming no projections/kwargs are present, and otherwise new axes are returned?

@dstansby
Copy link
Member Author

dstansby commented Feb 2, 2021

Yeah, I think that's what should happen - currently working on it.

@astrofrog
Copy link
Contributor

astrofrog commented Feb 2, 2021

@dstansby an alternative is to do as suggested in #18978 (comment) but then a warning does need to be raised as opposed to the current silent behavior. I'm not a fan of the axes reuse but if there is consensus about keeping the new behavior a warning has to be emitted (not just deprecation to be clear)

@dstansby dstansby deleted the axes-creation branch February 2, 2021 14:49
@QuLogic QuLogic removed this from the v3.4.0 milestone Mar 16, 2021
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.

Unexpected change in behavior in plt.subplot

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.