def _render_polygon(axes, polygons, segments, facecolor, edgecolor, filled=True,alpha=1.0):
vertices = []
codes = []
for polygon in polygons:
vertices.extend(polygon + [(0, 0)])
codes.extend(
[path.Path.MOVETO] +
[path.Path.LINETO] * (len(polygon) - 1) +
[path.Path.CLOSEPOLY])
if vertices and filled:
axes.add_patch(
patches.PathPatch(path.Path(vertices, codes), facecolor=facecolor, alpha=alpha))
linewidth = 1
if not filled: linewidth = 3
for sx, sy, tx, ty in segments:
axes.plot(
[sx, tx], [sy, ty],
linewidth=linewidth, color=edgecolor, zorder=1)
评论列表
文章目录