From 23a7275464abc74580d05a1b964ae8fadcceea8a Mon Sep 17 00:00:00 2001 From: Julian Linke <jlinke-tug@aim-gpu6.spsc.tugraz.at> Date: Tue, 1 Aug 2023 11:39:17 +0200 Subject: [PATCH] fontsizes similarity matrix --- local/plot_pca_similarities.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/local/plot_pca_similarities.py b/local/plot_pca_similarities.py index d087f29..55e6153 100644 --- a/local/plot_pca_similarities.py +++ b/local/plot_pca_similarities.py @@ -13,13 +13,14 @@ import faiss from mpl_toolkits.mplot3d import Axes3D import matplotlib.patches as patches -# List of predefined colors for each corpus (you can add more if you like) +# List of predefined colors for each corpus (you can add more if necessary) colors = ['tab:red', 'tab:blue', 'tab:green', 'tab:orange', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'] -# markersize + +# fontsize and markersize MS = 30 def main(X_path, y_path, pcaA_path, pcab_path, out_path, json_path): @@ -40,10 +41,17 @@ def main(X_path, y_path, pcaA_path, pcab_path, out_path, json_path): labels = list(spks) fig, ax = plt.subplots(figsize=(15,15)) cax = ax.matshow(X, interpolation='nearest') + # x-ticks fontsize + for label in ax.get_xticklabels(): + label.set_fontsize(25) + # y-ticks fontsize + for label in ax.get_yticklabels(): + label.set_fontsize(25) ax.grid() plt.xticks(range(len(labels)), labels, rotation=90); plt.yticks(range(len(labels)), labels); - fig.colorbar(cax, ticks=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, .8, .9, 1]) + cbar = fig.colorbar(cax, ticks=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, .8, .9, 1]) + cbar.ax.tick_params(labelsize=25) fig_path = os.path.join(out_path,'{}.png'.format(X_path.split('/')[-1].replace('.npy',''))) print('\nsave similarity matrix to {}'.format(fig_path)) plt.savefig(fig_path) -- GitLab