Polygon
An polygon, positioned by its bounding box.
- class pptx_shapes.shapes.Polygon(points: List[Tuple[float, float]], angle: float = 0, fill: pptx_shapes.style.fill_style.FillStyle | None = None, stroke: pptx_shapes.style.stroke_style.StrokeStyle | None = None)
Parameters
points(List[Tuple[float, float]]) – a list of tuples of(x, y)coordinates that define the vertices of the polygon.angle(float, optional) – rotation in degrees, default is0.fill(FillStyle, optional) – fill style.stroke(StrokeStyle, optional) – stroke style.
Example
from pptx_shapes.shapes import Polygon
from pptx_shapes.style import FillStyle, StrokeStyle
polygon = Polygon(
points=[(15, 5), (16, 6), (15, 7), (12, 7), (11, 6), (12, 5)],
angle=45,
fill=FillStyle(color="#88ff88"),
stroke=StrokeStyle(color="magenta", thickness=2.5)
)