Skip to content
Snippets Groups Projects
Commit 23a72754 authored by Julian Linke's avatar Julian Linke
Browse files

fontsizes similarity matrix

parent 24a0c493
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment