2
私は、複数のサブプロットを含むmatplotlibウィンドウを持っています。メソッドが呼び出されるたびに、各サブプロットの内容を動的に更新できるようにしたい。簡略化されたコードは次のようになります:既に開いているMatplotlib図のサブプロットを更新する
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(1)
fig, ax_list = plt.subplots(3, 2)
image1 = plt.imread("image1.jpg")
image2 = plt.imread("image2.jpg")
ax_list = ax_list.ravel()
ax_list[0].imshow(image1)
ax_list[1].imshow(image2)
plt.show()
def update_subplots():
# I want this method to change the contents of the subplots whenever it is called
pass
あなたがいることを言うことを意味既に開いているウィンドウのサブプロットを更新したいですか? – ThePredator
はい、それは正確に私が意味するものです – user3396592
どのようにそれらを更新するのですか? – tom