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

Function test_axes_margins

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

Source from the content-addressed store, hash-verified

7545
7546@mpl.style.context('default')
7547def test_axes_margins():
7548 fig, ax = plt.subplots()
7549 ax.plot([0, 1, 2, 3])
7550 assert ax.get_ybound()[0] != 0
7551
7552 fig, ax = plt.subplots()
7553 ax.bar([0, 1, 2, 3], [1, 1, 1, 1])
7554 assert ax.get_ybound()[0] == 0
7555
7556 fig, ax = plt.subplots()
7557 ax.barh([0, 1, 2, 3], [1, 1, 1, 1])
7558 assert ax.get_xbound()[0] == 0
7559
7560 fig, ax = plt.subplots()
7561 ax.pcolor(np.zeros((10, 10)))
7562 assert ax.get_xbound() == (0, 10)
7563 assert ax.get_ybound() == (0, 10)
7564
7565 fig, ax = plt.subplots()
7566 ax.pcolorfast(np.zeros((10, 10)))
7567 assert ax.get_xbound() == (0, 10)
7568 assert ax.get_ybound() == (0, 10)
7569
7570 fig, ax = plt.subplots()
7571 ax.hist(np.arange(10))
7572 assert ax.get_ybound()[0] == 0
7573
7574 fig, ax = plt.subplots()
7575 ax.imshow(np.zeros((10, 10)))
7576 assert ax.get_xbound() == (-0.5, 9.5)
7577 assert ax.get_ybound() == (-0.5, 9.5)
7578
7579
7580@pytest.fixture(params=['x', 'y'])

Callers

nothing calls this directly

Calls 10

get_yboundMethod · 0.80
barhMethod · 0.80
get_xboundMethod · 0.80
pcolorMethod · 0.80
pcolorfastMethod · 0.80
histMethod · 0.80
imshowMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
barMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…