| 9645 | |
| 9646 | |
| 9647 | def 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 | |
| 9668 | def test_small_autoscale(): |