MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_relim_visible_only

Function test_relim_visible_only

lib/matplotlib/tests/test_axes.py:6515–6537  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6513
6514
6515def test_relim_visible_only():
6516 x1 = (0., 10.)
6517 y1 = (0., 10.)
6518 x2 = (-10., 20.)
6519 y2 = (-10., 30.)
6520
6521 fig = matplotlib.figure.Figure()
6522 ax = fig.add_subplot()
6523 ax.plot(x1, y1)
6524 assert ax.get_xlim() == x1
6525 assert ax.get_ylim() == y1
6526 line, = ax.plot(x2, y2)
6527 assert ax.get_xlim() == x2
6528 assert ax.get_ylim() == y2
6529 line.set_visible(False)
6530 assert ax.get_xlim() == x2
6531 assert ax.get_ylim() == y2
6532
6533 ax.relim(visible_only=True)
6534 ax.autoscale_view()
6535
6536 assert ax.get_xlim() == x1
6537 assert ax.get_ylim() == y1
6538
6539
6540def test_relim_collection():

Callers

nothing calls this directly

Calls 7

add_subplotMethod · 0.80
relimMethod · 0.80
plotMethod · 0.45
get_xlimMethod · 0.45
get_ylimMethod · 0.45
set_visibleMethod · 0.45
autoscale_viewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…