Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix pyplot.axis(ax) when ax is in other figure. #8043
+15
−2
Conversation
|
Is there any chance you could add a test in def test_set_axes_different_figure():
f1, a1 = plt.subplots()
f2, a2 = plt.subplots()
plt.axes(a1)
assert plt.gca() is a1
assert plt.gcf() is f1This way we don't accidentally break it in the future. |
|
Sure, I'll get to it later today or tomorrow. |
tacaswell
added this to the
2.1 (next point release)
milestone
Feb 8, 2017
NelleV
changed the title from
Fix pyplot.axis(ax) when ax is in other figure. to [MRG+1] Fix pyplot.axis(ax) when ax is in other figure.
Feb 10, 2017
|
|
| @@ -1476,6 +1476,15 @@ def _as_mpl_axes(self): | ||
| 'Expected a PolarAxesSubplot, got %s' % type(ax) | ||
| plt.close() | ||
| + # test focusing of Axes in other Figure | ||
| + fig1, ax1 = subplots() |
pavoljuhas
Feb 10, 2017
Contributor
Indeed test_as_mpl_axes_api seems to be for customizations with the _as_mpl_axes function. I will add the new function.
| + # test focusing of Axes in other Figure | ||
| + fig1, ax1 = subplots() | ||
| + fig2, ax2 = subplots() | ||
| + assert ax1 is plt.axes(ax1) |
pavoljuhas
added some commits
Feb 10, 2017
dstansby
added the
needs_review
label
Feb 11, 2017
NelleV
merged commit 3d99e43
into matplotlib:master
Feb 11, 2017
5 checks passed
codecov/patch
100% of diff hit (target 80%)
Details
codecov/project/library
62.28% (+<.01%) compared to c15694b
Details
codecov/project/tests
97.97% (target 97.7%)
Details
continuous-integration/appveyor/pr
AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
pavoljuhas
deleted the
pavoljuhas:fix-pyplot-axes-in-other-figure branch
Feb 11, 2017
QuLogic
removed the
needs_review
label
Feb 12, 2017
QuLogic
changed the title from
[MRG+1] Fix pyplot.axis(ax) when ax is in other figure. to Fix pyplot.axis(ax) when ax is in other figure.
Feb 12, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pavoljuhas commentedFeb 7, 2017
Avoid crash when
axbelongs to some other than the current figure.Make the
axowner the current figure instead.This resolves crash in
axescall in the following stanza