我试着画两个不同的图,一个在另一个的左边,我试着用matplot的sublot,但是它把second图放下来了,另一个我怀疑我用错了子图,这是我的代码
# Create bars
from matplotlib.pyplot import figure
bar = plt.figure(figsize=(10,5))
plt.subplot(121)
plt.barh(plottl['Nombres'] ,plottl['Probas'])
presunto= plt.figure(figsize=(10,10))
presunto = plt.subplot(122)
img=mpimg.imread((predict+names[0]+ '/'+ onlyfiles[0]))
mgplot = plt.imshow(img)
plt.show()
predictions=[]
这是一张照片。正在发生的事情
我希望你能帮我解决这个问题,提前谢谢大家
编辑:我把照片放在这里
您正在创建2个图形,而不是2个子图,不过当您想要绘制不同大小的子图时,最好使用
gridspec
。看this link您正在创建2个图形,而不是一个具有2个子图的图形。删除行
presunto= plt.figure(figsize=(10,10))
,它应该可以工作相关问题 更多 >
编程相关推荐