text_plain_output_2.png text_plain_output_1.png image_output_1.png
fig = plt.figure(figsize=(20, 16))
c = 0
cc = 0
plt.suptitle('UMAP ' + str_data_inf + ' n_samples=' + str(len(X)), fontsize=20)
for min_dist in [0.1, 0.9]:
    for n_neighbors in [5, 15, 100]:
        c += 1
        fig.add_subplot(2, 3, c)
        str_inf = 'n_neighbors=' + str(n_neighbors) + ' min_dist=' + str(min_dist)
        reducer = umap.UMAP(n_neighbors=n_neighbors, min_dist=min_dist, n_components=2)
        r2 = reducer.fit_transform(X)
        i, j = (0, 1)
        ax = sns.scatterplot(x=r2[:, i], y=r2[:, j], hue=v4color, palette=palette1, marker=marker1, alpha=alpha1)
        if 1:
            plt.setp(ax.get_legend().get_texts(), fontsize=12)
            plt.setp(ax.get_legend().get_title(), fontsize=12)
        plt.title(str_inf, fontsize=20)
        plt.xlabel('UMAP' + str(i + 1), fontsize=20)
        plt.ylabel('UMAP' + str(j + 1), fontsize=20)
        if c == 1:
            plt.setp(ax.get_legend().get_texts(), fontsize=10)
            plt.setp(ax.get_legend().get_title(), fontsize=10)
            plt.legend(bbox_to_anchor=(1.15, 1.0), loc='upper right')
        else:
            plt.legend('')
plt.show()