def plot_distances_between_clusters()

in poincare_maps.py [0:0]


    def plot_distances_between_clusters(self, labels, pm_type='rot', eps = 4.0, file_name=None, fs=9):
        if pm_type == 'ori':
            poincare_coord = self.coordinates
        elif pm_type == 'rot':
            poincare_coord = self.coordinates_rotated

        cell_list = np.unique(labels)
        n = len(labels)    
        
        n_plt = len(cell_list)
        # n2 = int(np.sqrt(n_plt))
        n2 = 3
        n1 = n_plt // n2
        
        if n1*n2 < n_plt:
            n1 += 1

        if n1 == 1:
            n1 = 2
        
        if n2 == 1:
            n2 = 2

        f, axs = plt.subplots(n1, n2, sharey=False, figsize=(n2*3, n1*3))

        l=0
        for i in range(n1):
            for j in range(n2):
                if l < n_plt:
                    cell = np.random.choice(np.where(labels == cell_list[l])[0])

                    mycmap = self.distances[cell]

                    circle = plt.Circle((0, 0), radius=1, color='black', fc="None")
                    axs[i, j].add_patch(circle)
                    axs[i, j].axis('off')
                    axs[i, j].axis('equal')
                    axs[i, j].plot(0, 0, 'x', c=(0, 0, 0), ms=6)
                    cm = plt.cm.get_cmap('rainbow')
                    sc = axs[i, j].scatter(poincare_coord[:, 0], poincare_coord[:, 1], c=mycmap, s=15, cmap=cm)    
                    axs[i, j].set_title(cell_list[l], fontsize=fs)
                    axs[i, j].plot(poincare_coord[cell, 0], poincare_coord[cell, 1], 'd', c='red')
                else:
                    axs[i, j].axis('off')
                    axs[i, j].axis('equal')
                l+=1
        if file_name:
            plt.savefig(file_name + '.pdf', format='pdf')
        plt.show()
        plt.close(f)