如何让情节不消失?

2024-04-26 06:25:34 发布

您现在位置:Python中文网/ 问答频道 /正文

假设您需要将figuresubplot存储在变量中(以便以后修改属性)。你怎么能让整个数字在几毫秒后不迅速消失呢?

import matplotlib.pyplot as plt

fig = plt.figure() 

ax = fig.add_subplot(2,2,1)
ax.plot(1)

fig.show()

Tags: importadd属性plotmatplotlibasshowfig