def _plot_wordcloud(self, axis: mpl.axes.SubplotBase, wc: WordCloud, words: List[str], label: str): """Plot a given wordcloud on given axis. axis: mpl.axes.SubplotBase, the subplot on which to plot wx: WordCloud, wordcloud object to use words: List[str], list of words to plot label:str, label for wordcloud """ wordcloud = wc.generate(" ".join(words)) axis.imshow(wordcloud, interpolation='bilinear') axis.set_title("Word cloud - {label}".format(label=label)) plt.axis("off")
def plot_2_1_ci(ax: matplotlib.axes.SubplotBase, df_pred_str: pd.DataFrame, df_pred_str_null: pd.DataFrame, rows_set: np.ndarray) -> None: mu, sigma = ClusteringUtils.calc_distribution(df_pred_str.loc[rows_set]) mu_null, sigma_null = ClusteringUtils.calc_distribution(df_pred_str_null.loc[rows_set]) y = pd.DataFrame([ mu - sigma > mu_null + sigma_null ]) ax.imshow(y) ax.set_xlabel("k") ax.set_ylabel("CI intersection") ax.set_yticks([]) ax.xaxis.set_major_locator(ticker.FixedLocator((np.arange(len(y.columns))))) ax.xaxis.set_major_formatter(ticker.FixedFormatter(y.columns))