Skip to content

Fix pyplot.axis(ax) when ax is in other figure. #8043

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

Merged
merged 4 commits into from
Feb 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing module to plt.subplots call.
  • Loading branch information
pavoljuhas committed Feb 10, 2017
commit 383e256a0cada55bd326f6b15a8b0db9e6b2d66f
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,8 +1477,8 @@ def _as_mpl_axes(self):
plt.close()

# test focusing of Axes in other Figure
fig1, ax1 = subplots()
fig2, ax2 = subplots()
fig1, ax1 = plt.subplots()
fig2, ax2 = plt.subplots()
assert ax1 is plt.axes(ax1)
Copy link
Member

@dstansby dstansby Feb 10, 2017

Choose a reason for hiding this comment

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

These two lines need to be plt.subplots()

Copy link
Member

Choose a reason for hiding this comment

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

This comment is one line below where it should be.

Copy link
Member

Choose a reason for hiding this comment

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

Woops, thanks for spotting 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.

Fixed - thanks for catching that.

assert ax1 is plt.gca()
assert fig1 is plt.gcf()
Expand Down