Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix getting polar axes in plt.polar()#10674

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
dstansby wants to merge2 commits intomatplotlib:masterfromdstansby:axes-warning

Conversation

dstansby
Copy link
Member

@dstansbydstansby commentedMar 4, 2018
edited
Loading

Currentlyax = gca(polar=True) raises a warning, because in future version it will return a new subplot instead of returning an existing one.

This PR removes this warning, and ensuresplt.polar will behave well into the future by callinggca() without arguments. This means that if no axes are present, a new polar axes is manually created inplt.polar.

@dstansbydstansby added this to thev3.0 milestoneMar 4, 2018
@dstansbydstansby changed the titleRemove gca() warning from test_axesFix getting polar axes in plt.polar()Mar 5, 2018
"warning can be suppressed, and the future behavior "
"ensured, by passing a unique label to each axes "
"instance.")
"instance.\n"
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Also added some newlines here to make the warning more readable.

ax = gca(polar=True)
ax = gca()
else:
ax = gcf().add_subplot(1, 1, 1, polar=True)
Copy link
Member

Choose a reason for hiding this comment

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

umm, I'm not too up on the pyplot interface, but isgca() necessarilly asubplot(111)?

Copy link
Member

Choose a reason for hiding this comment

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

No, but: If there are axes, use the gca(). If not, make a new one equivalent to subplot(111).

Copy link
Member

Choose a reason for hiding this comment

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

OK, but I don't get the point of this PR then. Why is this better than whats there now? Is the idea to letplt.polar write on an existing polar axes, despite the factgca will create a new axes in the future? That doesn't seem right. Sorry if I'm being dense...

Copy link
Member

Choose a reason for hiding this comment

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

The wholegcasituation is incredibly confusing. I can't make sense of the current behavior and docstrings, and the warning about future behavior makes no sense to me either.gca means "get current axes"; it should not mean "always get a new axes". I think that the coming change tosubplot is being incorrectly applied togca.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The change was made in#10660 - I thinkgca should just get the current axis, and not create a new one, and that change should be reverted. ping@anntzer

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that the warning in#10660 is wrong. I need to rethink about the correct way to ultimately get rid of the axes collision behavior.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Great, I'll close this then.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring left review comments

@anntzeranntzeranntzer left review comments

@jklymakjklymakjklymak left review comments

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.0.0
Development

Successfully merging this pull request may close these issues.

5 participants
@dstansby@efiring@anntzer@jklymak@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp