Home > other >  [for] cases on the network to save moving figure because of what?
[for] cases on the network to save moving figure because of what?

Time:11-20

According to the online tutorial, copy and paste operation, not simply,
Themselves according to the revised version, is not the wrong version, but animation that step always can't do it, why?
Case from the classic version of on the network, whether to reject the paste, so added some mistake inside,
Someone called before the warning Ingnore directly, the forehead, you cow

The source code

 
The import matplotlib. Animation as ANI
The import matplotlib. Pyplot as PLT
The import numpy as np
The import pandas as pd

Url='C:/Users/user1/Desktop/20201111/df. CSV'
Df=pd read_csv (url, delimiter=', ', the header='infer')

Df_interest=df. Loc [df [' Country/Region]. The isin ([' United Kingdom ', 'US', 'in Italy', 'Germany']) & amp; df [' State/Province] isnull ()], copy ()
Df_interest. Rename (index=lambda x: df_interest at [x, 'the Country/Region], inplace=True)
Df1=df_interest. Transpose ()
Df1=df1. Drop ([' State/Province ', 'the Country/Region', 'Lat', 'Long'])
Df1=df1. Loc [(df1!=0). Any (1)]
Df1) index=pd) to_datetime (df1 index)

Color='red', 'green' and 'blue', 'orange']
FIG.=PLT figure ()
PLT. Xticks (rotation=45, ha="right", rotation_mode="anchor") # rotate the x axis values
PLT. Subplots_adjust (bottom=0.2, top=0.9) # ensuring the dates (on the x axis) fit in the screen
PLT. Ylabel (' No of number ')
PLT. Xlabel (' Datas')

Def buildmebarchart (I=int) :
PLT. Legend (df1. Columns)
P=PLT. The plot (df1 [, I]. Index and df1 [, I]. Values) # note it only returns the dataset, up to the point I
For I in range (0, 4) :
P [I] set_color (color) [I] # set the color of each curve

PLT. RcParams [' animation. Ffmpeg_path]='C:/ffmpeg/bin/ffmpeg. Exe'

Animator=ANI. FuncAnimation (FIG, buildmebarchart, interval=100)

PLT. The show ()

Animator. Save (' C:/temp/myfirstAnimation. GIF, writer='pillow')


Unable to save the dynamic figure, then Plt. The show () is what all not,
  • Related