in poincare_maps.py [0:0]
def plot_markers_radius(self, data, markesnames, labels, file_name=None, fs=8):
pm_pseudotime = np.sqrt(self.coordinates_rotated[:,0]**2 + self.coordinates_rotated[:,1]**2)
n_plt = len(markesnames)
# n2 = int(np.sqrt(n_plt))
n2 = 2
n1 = n_plt // n2
if n1*n2 < n_plt:
n1 += 1
if n1 == 1:
n1 = 2
if n2 == 1:
n2 = 2
fig, axs = plt.subplots(n1, n2, sharex=True, sharey=False, figsize=(n2*4 + 3, n1*4))
i = 0
for i1 in range(n1):
for i2 in range(n2):
axs[i1, i2].grid('off')
axs[i1, i2].axis('equal')
axs[i1, i2].yaxis.set_tick_params(labelsize=fs)
axs[i1, i2].xaxis.set_tick_params(labelsize=fs)
if i < n_plt:
marker = markesnames[i]
for j, label in enumerate(np.unique(labels)):
idx = np.where(labels == label)[0]
axs[i1, i2].plot(pm_pseudotime[idx], data[idx, i], marker='o', markerfacecolor='none', c=self.colors_palette[j], linestyle='', ms=2, label=marker)
axs[i1, i2].set_title(marker, fontsize=fs)
i += 1
if i == n_plt:
axs[i1, i2].legend(np.unique(labels), loc='center left', bbox_to_anchor=(1, 0.5), fontsize=fs)
else:
axs[i1, i2].axis('off')
for ax in axs.flat:
ax.set(xlabel='radius')
# Hide x labels and tick labels for top plots and y ticks for right plots.
for ax in axs.flat:
ax.label_outer()
if file_name:
plt.savefig(file_name + '.pdf', format='pdf')
plt.show()
plt.close(fig)