plot.py 文件源码

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

项目:quadpy 作者: nschloe 项目源码 文件源码
def plot_disks(plt, pts, weights, total_area):
    '''Plot a circles at quadrature points according to weights.
    '''
    flt = numpy.vectorize(float)
    pts = flt(pts)
    weights = flt(weights)
    radii = numpy.sqrt(abs(weights)/math.fsum(weights) * total_area/math.pi)
    colors = [
        # use matplotlib 2.0's color scheme
        '#1f77b4' if weight >= 0 else '#d62728'
        for weight in weights
        ]
    _plot_disks_helpers(plt, pts, radii, colors)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号