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

Function test_bezier_autoscale

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

Source from the content-addressed store, hash-verified

9645
9646
9647def test_bezier_autoscale():
9648 # Check that bezier curves autoscale to their curves, and not their
9649 # control points
9650 verts = [[-1, 0],
9651 [0, -1],
9652 [1, 0],
9653 [1, 0]]
9654 codes = [mpath.Path.MOVETO,
9655 mpath.Path.CURVE3,
9656 mpath.Path.CURVE3,
9657 mpath.Path.CLOSEPOLY]
9658 p = mpath.Path(verts, codes)
9659
9660 fig, ax = plt.subplots()
9661 ax.add_patch(mpatches.PathPatch(p))
9662 ax.autoscale()
9663 # Bottom ylim should be at the edge of the curve (-0.5), and not include
9664 # the control point (at -1)
9665 assert ax.get_ylim()[0] == -0.5
9666
9667
9668def test_small_autoscale():

Callers

nothing calls this directly

Calls 4

add_patchMethod · 0.80
subplotsMethod · 0.45
autoscaleMethod · 0.45
get_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…