def debugplot(self, u = None):
print 'creating plot...'
n = len(self.region['members'][0]) / 2
plt.figure(figsize=(6, n/2*4+1))
m = self.region['members']
d = self.region['maxdistance']
for i in range(n):
plt.subplot(numpy.ceil(n / 2.), 2, 1+i)
j = i * 2
k = i * 2 + 1
plt.plot(m[:,j], m[:,k], 'x', color='b', ms=1)
plt.gca().add_artist(plt.Circle((m[0,j], m[0,k]), d, color='g', alpha=0.3))
if u is not None:
plt.plot(u[j], u[k], 's', color='r')
plt.gca().add_artist(plt.Circle((u[j], u[k]), d, color='r', alpha=0.3))
prefix='friends%s-%s_' % ('1' if self.jackknife else '', self.metric)
plt.savefig(prefix + 'cluster.pdf')
plt.close()
print 'creating plot... done'
评论列表
文章目录