segs = xy[:, ind_bones].swapaxes(1, 2)
s = cfg["dotsize"]
alpha = cfg["alphavalue"]
if all_same_shape: // Very efficient, avoid re-drawing the whole plot
fig, ax = prepare_figure_axes(w, h, scale, dpi)
im = ax.imshow(np.zeros((h, w)), "gray")
pts = [ax.plot([], [], keypoint, ms=s, alpha=alpha, color=c)[0] for c in colors]
coll = LineCollection([], colors=cfg["skeleton_color"], alpha=alpha)
ax.add_collection(coll)
for i in trange(len(ic)):