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
评论列表
文章目录