3 回答

TA貢獻1777條經(jīng)驗 獲得超3個贊
Figure
吡咯烷酮界面
pyplot
pyplot
import matplotlib.pyplot as plt
plt.cla()
plt.clf()
plt.close()
close()
figure(number_or_name)
fig
fig = figure()
close()
close('all')
圖類的方法
Figure
fig
Figure
:
fig.clf()
plt.clf()
fig
fig.clear()
fig.clf()
del fig
plt.close(fig)

TA貢獻1848條經(jīng)驗 獲得超10個贊
plt.close(fig)
fig.clf()
for i in range(5): fig = plot_figure() plt.close(fig)# This returns a list with all figure numbers availableprint(plt.get_fignums())
for i in range(5): fig = plot_figure() fig.clf()# This returns a list with all figure numbers availableprint(plt.get_fignums())
import numpy as npimport matplotlib.pyplot as plt x = np.arange(1000)y = np.sin(x)for i in range(5): fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(x, y) plt.close(fig)print(plt.get_fignums())for i in range(5): fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(x, y) fig.clf()print(plt.get_fignums())

TA貢獻1853條經(jīng)驗 獲得超6個贊
plt.cla()
plt.clf()
- 3 回答
- 0 關(guān)注
- 3255 瀏覽
添加回答
舉報