allow to provide RDM title (rdm_descriptor) even if the provided string is not in rdm.rdm_descriptors
@@ -40,8 +40,10 @@ def show_rdm(rdm, do_rank_transform=False, pattern_descriptor=None,
plt.subplot(n, m, idx + 1)
plt.imshow(rdm_mat[idx], cmap=cmap)
_add_descriptor_labels(rdm, pattern_descriptor)
- if rdm_descriptor:
+ if rdm_descriptor in rdm.rdm_descriptors:
plt.title(rdm.rdm_descriptors[rdm_descriptor][idx])
+ elif isinstance(rdm_descriptor, str):
+ plt.title(rdm_descriptor)
plt.subplot(n, m, n * m)
plt.imshow(np.mean(rdm_mat, axis=0), cmap=cmap)
_add_descriptor_labels(rdm, pattern_descriptor)
@@ -49,8 +51,10 @@ def show_rdm(rdm, do_rank_transform=False, pattern_descriptor=None,
elif rdm.n_rdm == 1:
plt.imshow(rdm_mat[0], cmap=cmap)
_add_descriptor_labels(rdm, pattern_descriptor)
- if rdm_descriptor:
+ if rdm_descriptor in rdm.rdm_descriptors:
plt.title(rdm.rdm_descriptors[rdm_descriptor][0])
+ elif isinstance(rdm_descriptor, str):
+ plt.title(rdm_descriptor)
plt.show()
