I have 2 plots in python and when plotting them separately as done in the first 2 sections of codes, it correctly displays the first 2 graphs. However, when trying to make a subplot of the 2 graphs beneath each other, the following picture is rendered by python. What am I doing wrong here?
K1 = 1
K2 = [[0. 0. 0.]
[0. 3. 0.]
[0. 0. 0.]]
# visualizing the source function
plt.clf()
plt.imshow([[K1, K1],
[K1, K1]], cmap='viridis')
plt.colorbar()
plt.show()
plt.clf()
plt.imshow(K2, cmap='viridis')
plt.colorbar()
plt.show()
# visualizing the source function
plt.clf()
plt.imshow([[K1, K1],
[K1, K1]], cmap='viridis')
plt.colorbar()
plt.subplot(2, 1, 1)
plt.clf()
plt.imshow(K2, cmap='viridis')
plt.colorbar()
plt.subplot(2, 1, 2)
plt.show()



