visualize.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:icfpc2016-judge 作者: icfpc2016 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号