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