我想在Matplotlib中显示多个图形.这是我的代码:
for i in range(8):
a = sitk.ReadImage("000%d.IMA"%(i+1))
...
plt.figure(i+1)
plt.imshow(a_np,cmap=plt.cm.gray)
Run Code Online (Sandbox Code Playgroud)
但是,图(1)至图(7)将在过程中显示,但只有图(8)保持在最后.我怎样才能同时看到所有数字?当我将环境改为spyder时,我的环境是Ipython笔记本,这让我很困惑.
我有这样的数据帧
>>df1 = pd.DataFrame({'A': ['1', '2', '3', '4','5'],
'B': ['1', '1', '1', '1','1'],
'C': ['c', 'A1', None, 'c3',None],
'D': ['d0', 'B1', 'B2', None,'B4'],
'E': ['A', None, 'S', None,'S'],
'F': ['3', '4', '5', '6','7'],
'G': ['2', '2', None, '2','2']})
>>df1
A B C D E F G
0 1 1 c d0 A 3 2
1 2 1 A1 B1 None 4 2
2 3 1 None B2 S 5 None
3 4 1 c3 None None 6 2
4 5 …Run Code Online (Sandbox Code Playgroud)