plot.py 文件源码

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

项目:quadpy 作者: nschloe 项目源码 文件源码
def plot_disks_1d(plt, pts, weights, total_area):
    '''Plot a circles at quadrature points according to weights. The diameters
    sum up to the total area.
    '''
    radii = 0.5 * abs(weights)/math.fsum(weights) * total_area
    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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号