Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2fd5ed

Browse filesBrowse files
committed
fix test_stairs_update
We have to use fixed view limits because stairs() does autoscale, but updating data does not. Otherwise the test and ref way of generating the plot would end up with different view limits.
1 parent 96ebbed commit b2fd5ed
Copy full SHA for b2fd5ed

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,9 +1878,12 @@ def test_stairs_fill(fig_test, fig_ref):
18781878

18791879
@check_figures_equal(extensions=['png'])
18801880
def test_stairs_update(fig_test, fig_ref):
1881+
# fixed ylim because stairs() does autoscale, but updating data does not
1882+
ylim = -3, 4
18811883
# Test
18821884
test_ax = fig_test.add_subplot()
18831885
h = test_ax.stairs([1, 2, 3])
1886+
test_ax.set_ylim(ylim)
18841887
h.set_values([3, 2, 1])
18851888
h.set_edges(np.arange(4)+2)
18861889
h.set_data([1, 2, 1], np.arange(4)/2)
@@ -1891,9 +1894,10 @@ def test_stairs_update(fig_test, fig_ref):
18911894
h.set_baseline(-2)
18921895
assert h.get_baseline() == -2
18931896

1894-
# # Ref
1897+
# Ref
18951898
ref_ax = fig_ref.add_subplot()
18961899
h = ref_ax.stairs([1, 2, 3], baseline=-2)
1900+
ref_ax.set_ylim(ylim)
18971901

18981902

18991903
def test_stairs_invalid_nan():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.