c = file('cluster_info.txt')
for i in zip(ys[-10:],result): # has ten elements
for j in c.readlines():
cluster = j.split(',')
if q in cluster:
m = (q[i],cluster[0])
f = pylab.figure() # code for plot starts here
for n, fname in enumerate(m):
image=Image.open(fname).convert("L")
arr=np.asarray(image)
f.add_subplot(2, 1, n) # this line outputs images on top of each other
pylab.imshow(arr,cmap=cm.Greys_r)
pylab.title("%s, Top:Predicted,Bottom:Observed" %i[0])
pylab.show()
else:
continue
위 코드는 더 큰 코드의 코드 조각으로 10 개의 이미지/플롯을 생성하지만 파이썬에서는 플롯이 생성되지 않습니다. 나는 if와 else를 중첩하지 않을 것이라고 생각한다 : for 루프에서 올바르게. 여기서 뭐가 잘못 됐는지 말해줘.if 문이 for 루프에 중첩 된 경우
do-my-work-for-me 태그는 어디에 있습니까? – Begemoth