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

Added axes inversion to cla() #8455

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 14 commits into from
Apr 16, 2017
Merged
Prev Previous commit
Next Next commit
removed a trailing whitespace
  • Loading branch information
jrmlhermitte authored and Julien L committed Apr 14, 2017
commit 8c47c5522a175e986288c0678068d76f2abb0055
12 changes: 7 additions & 5 deletions 12 lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,28 +185,30 @@ def test_inverted_cla():
# plotting an image, then 1d graph, axis is now down
fig = plt.figure(0)
ax = fig.gca()
# test that a new axis is not inverted per default
# 1. test that a new axis is not inverted per default
assert not(ax.xaxis_inverted())
assert not(ax.yaxis_inverted())
img = np.random.random((100, 100))
ax.imshow(img)
# test that a image axis is inverted
# 2. test that a image axis is inverted
assert not(ax.xaxis_inverted())
assert ax.yaxis_inverted()
# 3. test that clearing and plotting a line, axes are
# not inverted
ax.cla()
x = np.linspace(0, 2*np.pi, 100)
ax.plot(x, np.cos(x))
assert not(ax.xaxis_inverted())
assert not(ax.yaxis_inverted())

# autoscaling should not bring back axes to normal
# 4. autoscaling should not bring back axes to normal
ax.cla()
ax.imshow(img)
plt.autoscale()
assert not(ax.xaxis_inverted())
assert ax.yaxis_inverted()

# two shared axes. Clearing the master axis should bring axes in shared
# 5. two shared axes. Clearing the master axis should bring axes in shared
# axies back to normal
ax0 = plt.subplot(211)
ax1 = plt.subplot(212, sharey=ax0)
Expand All @@ -215,7 +217,7 @@ def test_inverted_cla():
ax0.cla()
assert not(ax1.yaxis_inverted())
ax1.cla()
# clearing the nonmaster should not touch limits
# 6. clearing the nonmaster should not touch limits
ax0.imshow(img)
ax1.plot(x, np.cos(x))
ax1.cla()
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.