" char:[granular_ammount_of_speech.loc[scene, char].tokens if granular_ammount_of_speech.index.isin([(scene, char)]).any() else 0 for scene in scenes]\n",
" for char in granular_ammount_of_speech.index.levels[1]\n",
"}\n",
"width = 1\n",
"tokens\n",
"\n",
"fig, ax = plt.subplots(figsize=(12,8))\n",
"bottom = np.zeros(len(scenes))\n",
"\n",
"for boolean, tokens in tokens.items():\n",
" p = ax.bar(scenes, tokens, width, label=boolean, bottom=bottom)\n",
" bottom += tokens\n",
"\n",
"ax.set_title(\"Character participation on each scene\")\n",