3 回答

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超3個(gè)贊
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')
圖類(lèi)的方法
Figure
fig
Figure
:
fig.clf()
plt.clf()
fig
fig.clear()
fig.clf()
del fig
plt.close(fig)

TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超10個(gè)贊
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貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊
plt.cla()
plt.clf()
- 3 回答
- 0 關(guān)注
- 3287 瀏覽
添加回答
舉報(bào)