@@ -1542,7 +1542,7 @@ def is_list(variable):
15421542
15431543 if ndims == 3 :
15441544 if this_poloidal_plot :
1545- polys , da , update_func = animate_polygon (
1545+ update_func = animate_polygon (
15461546 data ,
15471547 ax = ax ,
15481548 cax = cax ,
@@ -1552,7 +1552,7 @@ def is_list(variable):
15521552 animate = False ,
15531553 ** this_kwargs ,
15541554 )
1555- animate_data .append ([ polys , da , update_func ] )
1555+ animate_data .append (update_func )
15561556 else :
15571557 raise ValueError (
15581558 "Unsupported option "
@@ -1572,15 +1572,14 @@ def is_list(variable):
15721572 ax .set_title (this_title )
15731573
15741574 def update (frame ):
1575- for list in animate_data :
1576- (polys , da , update_func ) = list
1575+ for update_func in animate_data :
15771576 # call update function for each axes
1578- update_func (frame , polys , da )
1577+ update_func (frame )
15791578
15801579 # make the animation for all the subplots simultaneously
1581- # use the last data array da to choose the number of frames
1580+ # use time data array "t" to choose the number of frames
15821581 # assumes time dimension same length for all variables
1583- anim = FuncAnimation (fig = fig , func = update , frames = np . shape ( da . data )[ 0 ] , interval = 30 )
1582+ anim = FuncAnimation (fig = fig , func = update , frames = self . data [ "t" ]. data . size , interval = 30 )
15841583 if tight_layout :
15851584 if subplots_adjust is not None :
15861585 warnings .warn (
0 commit comments