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

Function test_relim_collection_log_scale

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

Source from the content-addressed store, hash-verified

6581
6582
6583def test_relim_collection_log_scale():
6584 # GH#30859 - relim() for Collection on a log-scaled axis should
6585 # correctly propagate minpos into dataLim.
6586 fig, ax = plt.subplots()
6587 ax.set_xscale('log')
6588 ax.set_yscale('log')
6589 sc = ax.scatter([1e-3, 1e-2, 1e-1], [1e1, 1e2, 1e3])
6590 sc.set_offsets([[1e1, 1e4], [1e2, 1e5]])
6591 ax.relim()
6592 expected = sc.get_datalim(ax.transData)
6593 assert_allclose(ax.dataLim.get_points(), expected.get_points())
6594 assert_allclose(ax.dataLim.minpos, expected.minpos)
6595
6596
6597def test_relim_collection_autoscale_view():

Callers

nothing calls this directly

Calls 8

set_xscaleMethod · 0.80
relimMethod · 0.80
subplotsMethod · 0.45
set_yscaleMethod · 0.45
scatterMethod · 0.45
set_offsetsMethod · 0.45
get_datalimMethod · 0.45
get_pointsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…