Python 打印图像前打印文本(matplotlib/imageio)

Python 打印图像前打印文本(matplotlib/imageio),python,matplotlib,Python,Matplotlib,我对Python非常陌生(而且对使用MatPlotLib和imageio也非常陌生),我想知道是否有可能先打印图像,然后打印一些文本。 我的意思是:当你给予: plt.imshow(imageio.imread(<location>)) print('Test') print('Test')) plt.imshow(imageio.imread()) 它首先打印文本,然后打印图像,但当您给出: plt.imshow(imageio.imread(<location>)

我对Python非常陌生(而且对使用MatPlotLib和imageio也非常陌生),我想知道是否有可能先打印图像,然后打印一些文本。
我的意思是:当你给予:

plt.imshow(imageio.imread(<location>))
print('Test')
print('Test'))
plt.imshow(imageio.imread())
它首先打印文本,然后打印图像,但当您给出:

plt.imshow(imageio.imread(<location>))
print('Test')
plt.imshow(imageio.imread())
打印(‘测试’)
它仍然会先打印文本。
有解决办法吗?如果没有,还有其他方法吗?

imshow
之后使用
plt.show()

import matplotlib.pylab as plt 
from numpy import random

Z = random.random((20,20))   # Test data 

plt.imshow(Z, cmap=plt.get_cmap("Spectral"), interpolation='nearest') # Test plot

plt.show()
print("test")
C=np.random.rand(500).reshape((20,25))
S=np.random.rand(500).reshape((20,25))

def function(s,c):
    return s*2+c

dc = function(S,C)
结果是:

plt.imshow()之后使用
plt.show()


导入图像IO
将matplotlib.pyplot作为plt导入
打印(‘测试’)
plt.imshow(dc)
#它首先打印文本,然后打印图像,但是当您
#plt.imshow(imageio.imread())
plt.show()
打印(‘测试’)


好问题,面对类似的问题。