Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5697ba9

Browse files
committed
restore test that was inadvertently removed by 5901b38
1 parent 5901b38 commit 5697ba9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4799,6 +4799,21 @@ def test_fillbetween_cycle():
47994799
assert tuple(cc.get_edgecolors().squeeze()) == tuple(edge_target)
48004800

48014801

4802+
@cleanup
4803+
def test_log_margins():
4804+
plt.rcParams['axes.autolimit_mode'] = 'data'
4805+
fig, ax = plt.subplots()
4806+
margin = 0.05
4807+
ax.set_xmargin(margin)
4808+
ax.semilogx([1, 10], [1, 10])
4809+
xlim0, xlim1 = ax.get_xlim()
4810+
transform = ax.xaxis.get_transform()
4811+
xlim0t, xlim1t = transform.transform([xlim0, xlim1])
4812+
x0t, x1t = transform.transform([1, 10])
4813+
delta = (x1t - x0t) * margin
4814+
assert_allclose([xlim0t + delta, xlim1t - delta], [x0t, x1t])
4815+
4816+
48024817
@cleanup
48034818
def test_color_length_mismatch():
48044819
N = 5
@@ -4809,4 +4824,4 @@ def test_color_length_mismatch():
48094824
ax.scatter(x, y, c=colors)
48104825
c_rgb = (0.5, 0.5, 0.5)
48114826
ax.scatter(x, y, c=c_rgb)
4812-
ax.scatter(x, y, c=[c_rgb] * N)
4827+
ax.scatter(x, y, c=[c_rgb] * N)

0 commit comments

Comments
 (0)