Skip to content

Commit fe34ad2

Browse files
jenshnielsenefiring
authored andcommitted
Add test for tight=True in autoscale
1 parent 80f868a commit fe34ad2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_axes.py

+10
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ def test_autoscale_tiny_range():
167167
ax[i].plot([0, 1], [1, 1 + y1])
168168

169169

170+
@cleanup
171+
def test_autoscale_tight():
172+
fig, ax = plt.subplots(1, 1)
173+
ax.plot([1, 2, 3, 4])
174+
ax.autoscale(enable=True, axis='x', tight=False)
175+
ax.autoscale(enable=True, axis='y', tight=True)
176+
assert_allclose(ax.get_xlim(), (-0.15, 3.15))
177+
assert_allclose(ax.get_ylim(), (1.0, 4.0))
178+
179+
170180
@image_comparison(baseline_images=['offset_points'],
171181
remove_text=True)
172182
def test_basic_annotate():

0 commit comments

Comments
 (0)