Python matplotlib two lines of code to draw gif

Prepare some pictures in advance
Insert picture description here

import imageio        # GIF图
# 画gif图
frames = [imageio.imread(f'.\image\元胞自动机\The status of DrugReports in {year}.png') for year in range(2010,2018)]
imageio.mimsave(fr'.\image\元胞自动机\2010-2017变化图.gif', frames, 'GIF', duration = 1.5)

Insert picture description here

Guess you like

Origin blog.csdn.net/Caiqiudan/article/details/112797058