def draw_group(data, panel_params, coord, ax, **params):
data = coord.transform(data, panel_params, munch=True)
data['size'] *= SIZE_FACTOR
verts = [None] * len(data)
limits = zip(data['xmin'], data['xmax'],
data['ymin'], data['ymax'])
for i, (l, r, b, t) in enumerate(limits):
verts[i] = [(l, b), (l, t), (r, t), (r, b)]
fill = to_rgba(data['fill'], data['alpha'])
color = data['color']
# prevent unnecessary borders
if all(color.isnull()):
color = 'none'
col = PolyCollection(
verts,
facecolors=fill,
edgecolors=color,
linestyles=data['linetype'],
linewidths=data['size'],
transOffset=ax.transData,
zorder=params['zorder'])
ax.add_collection(col)
评论列表
文章目录