Skip to content

Commit

Permalink
Merge pull request #795 from manuelaghito/dev
Browse files Browse the repository at this point in the history
Fix for animation_profile() and animate_vertical_distribution() in interactive mode
  • Loading branch information
knutfrode authored Dec 8, 2021
2 parents f5ce883 + 85ff187 commit bd98494
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions opendrift/models/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3729,19 +3729,21 @@ def plot_timestep(i):
if compare is not None:
frames = min(x.shape[0], cd['x_other'].shape[1])

blit = sys.platform != 'darwin' # blitting does not work on mac os

self.__save_or_plot_animation__(plt.gcf(),
plot_timestep,
filename,
frames,
fps,
interval=50)
interval=50,
blit = blit)

logger.info('Time to make animation: %s' %
(datetime.now() - start_time))

def __save_or_plot_animation__(self, figure, plot_timestep, filename,
frames, fps, interval):
blit = sys.platform != 'darwin' # blitting does not work on mac os
frames, fps, interval, blit):

if filename is not None or 'sphinx_gallery' in sys.modules:
logger.debug("Saving animation..")
Expand Down Expand Up @@ -3922,7 +3924,8 @@ def plot_timestep(i):
filename,
x.shape[1],
fps,
interval=150)
interval=150,
blit=False)

logger.info('Time to make animation: %s' %
(datetime.now() - start_time))
Expand Down
3 changes: 2 additions & 1 deletion opendrift/models/oceandrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ def update_histogram(i):
filename,
frames = len(times),
fps = 10,
interval=50)
interval=50,
blit=False)

logger.info('Time to make animation: %s' %
(datetime.now() - start_time))
Expand Down

0 comments on commit bd98494

Please sign in to comment.