Advertisement
brainuser5705

matplotlib stacking with multiple cats

Jun 23rd, 2022
970
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prev = np.array(0) # bottom can accept 0
  2.     for cat in dists:
  3.         ax.bar(labels, dists[cat], label=cat, bottom=prev)
  4.         prev = prev + np.array(dists[cat])
Advertisement
RAW Paste Data Copied
Advertisement