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

Function test_box_aspect_custom_position

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

Source from the content-addressed store, hash-verified

9008
9009
9010def test_box_aspect_custom_position():
9011 # Test if axes with custom position and box_aspect
9012 # behaves the same independent of the order of setting those.
9013
9014 fig1, ax1 = plt.subplots()
9015 ax1.set_position([0.1, 0.1, 0.9, 0.2])
9016 fig1.canvas.draw()
9017 ax1.set_box_aspect(1.)
9018
9019 fig2, ax2 = plt.subplots()
9020 ax2.set_box_aspect(1.)
9021 fig2.canvas.draw()
9022 ax2.set_position([0.1, 0.1, 0.9, 0.2])
9023
9024 fig1.canvas.draw()
9025 fig2.canvas.draw()
9026
9027 bb1 = ax1.get_position()
9028 bb2 = ax2.get_position()
9029
9030 assert_array_equal(bb1.extents, bb2.extents)
9031
9032
9033def test_bbox_aspect_axes_init():

Callers

nothing calls this directly

Calls 5

subplotsMethod · 0.45
set_positionMethod · 0.45
drawMethod · 0.45
set_box_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…