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

Method ensure_quadratic_bezier

lib/matplotlib/patches.py:3380–3393  ·  view source on GitHub ↗

Some ArrowStyle classes only works with a simple quadratic Bézier curve (created with `.ConnectionStyle.Arc3` or `.ConnectionStyle.Angle3`). This static method checks if the provided path is a simple quadratic Bézier curve and returns its

(path)

Source from the content-addressed store, hash-verified

3378
3379 @staticmethod
3380 def ensure_quadratic_bezier(path):
3381 """
3382 Some ArrowStyle classes only works with a simple quadratic
3383 Bézier curve (created with `.ConnectionStyle.Arc3` or
3384 `.ConnectionStyle.Angle3`). This static method checks if the
3385 provided path is a simple quadratic Bézier curve and returns its
3386 control points if true.
3387 """
3388 segments = list(path.iter_segments())
3389 if (len(segments) != 2 or segments[0][1] != Path.MOVETO or
3390 segments[1][1] != Path.CURVE3):
3391 raise ValueError(
3392 "'path' is not a valid quadratic Bezier curve")
3393 return [*segments[0][0], *segments[1][0]]
3394
3395 def transmute(self, path, mutation_size, linewidth):
3396 """

Callers 3

transmuteMethod · 0.80
transmuteMethod · 0.80
transmuteMethod · 0.80

Calls 1

iter_segmentsMethod · 0.80

Tested by

no test coverage detected