Skip to content

Commit

Permalink
test for shared log axes
Browse files Browse the repository at this point in the history
  • Loading branch information
efiring committed Dec 11, 2016
1 parent a8e7575 commit aa36ec3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ def test_autoscale_tight():
assert_allclose(ax.get_xlim(), (-0.15, 3.15))
assert_allclose(ax.get_ylim(), (1.0, 4.0))


@cleanup(style='default')
def test_autoscale_log_shared():
# related to github #7587
# array starts at zero to trigger _minpos handling
x = np.arange(100, dtype=float)
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
ax1.loglog(x, x)
ax2.semilogx(x, x)
ax1.autoscale(tight=True)
ax2.autoscale(tight=True)
plt.draw()
lims = (x[1], x[-1])
assert_allclose(ax1.get_xlim(), lims)
assert_allclose(ax1.get_ylim(), lims)
assert_allclose(ax2.get_xlim(), lims)
assert_allclose(ax2.get_ylim(), (x[0], x[-1]))


@cleanup(style='default')
def test_use_sticky_edges():
fig, ax = plt.subplots()
Expand Down

0 comments on commit aa36ec3

Please sign in to comment.