We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5901b38 + 5697ba9 commit d3d10d1Copy full SHA for d3d10d1
lib/matplotlib/tests/test_axes.py
@@ -4799,6 +4799,21 @@ def test_fillbetween_cycle():
4799
assert tuple(cc.get_edgecolors().squeeze()) == tuple(edge_target)
4800
4801
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
4817
@cleanup
4818
def test_color_length_mismatch():
4819
N = 5
@@ -4809,4 +4824,4 @@ def test_color_length_mismatch():
4824
ax.scatter(x, y, c=colors)
4825
c_rgb = (0.5, 0.5, 0.5)
4826
ax.scatter(x, y, c=c_rgb)
- ax.scatter(x, y, c=[c_rgb] * N)
4827
+ ax.scatter(x, y, c=[c_rgb] * N)
0 commit comments