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

Function test_square_plot

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

Source from the content-addressed store, hash-verified

7325
7326
7327def test_square_plot():
7328 x = np.arange(4)
7329 y = np.array([1., 3., 5., 7.])
7330 fig, ax = plt.subplots()
7331 ax.plot(x, y, 'mo')
7332 ax.axis('square')
7333 xlim, ylim = ax.get_xlim(), ax.get_ylim()
7334 assert np.diff(xlim) == np.diff(ylim)
7335 assert ax.get_aspect() == 1
7336 assert_array_almost_equal(
7337 ax.get_position(original=True).extents, (0.125, 0.1, 0.9, 0.9))
7338 assert_array_almost_equal(
7339 ax.get_position(original=False).extents, (0.2125, 0.1, 0.8125, 0.9))
7340
7341
7342def test_bad_plot_args():

Callers

nothing calls this directly

Calls 7

subplotsMethod · 0.45
plotMethod · 0.45
axisMethod · 0.45
get_xlimMethod · 0.45
get_ylimMethod · 0.45
get_aspectMethod · 0.45
get_positionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…