Skip to content

Commit

Permalink
Merge pull request matplotlib#7435 from efiring/restore_test
Browse files Browse the repository at this point in the history
restore test that was inadvertently removed by 5901b38
  • Loading branch information
efiring authored Nov 9, 2016
2 parents 5901b38 + 5697ba9 commit d3d10d1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4799,6 +4799,21 @@ def test_fillbetween_cycle():
assert tuple(cc.get_edgecolors().squeeze()) == tuple(edge_target)


@cleanup
def test_log_margins():
plt.rcParams['axes.autolimit_mode'] = 'data'
fig, ax = plt.subplots()
margin = 0.05
ax.set_xmargin(margin)
ax.semilogx([1, 10], [1, 10])
xlim0, xlim1 = ax.get_xlim()
transform = ax.xaxis.get_transform()
xlim0t, xlim1t = transform.transform([xlim0, xlim1])
x0t, x1t = transform.transform([1, 10])
delta = (x1t - x0t) * margin
assert_allclose([xlim0t + delta, xlim1t - delta], [x0t, x1t])


@cleanup
def test_color_length_mismatch():
N = 5
Expand All @@ -4809,4 +4824,4 @@ def test_color_length_mismatch():
ax.scatter(x, y, c=colors)
c_rgb = (0.5, 0.5, 0.5)
ax.scatter(x, y, c=c_rgb)
ax.scatter(x, y, c=[c_rgb] * N)
ax.scatter(x, y, c=[c_rgb] * N)

0 comments on commit d3d10d1

Please sign in to comment.