Skip to content

Commit

Permalink
animations
Browse files Browse the repository at this point in the history
  • Loading branch information
StFroese committed Jul 13, 2023
1 parent a6f80f5 commit e9c015a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def setup(app):
"line_numbers": True,
"default_thumb_file": "ctapipe_logo.png",
"pypandoc": True,
"matplotlib_animations": True,
}


Expand Down
11 changes: 2 additions & 9 deletions examples/examples/visualization/camera_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
from IPython import display
from matplotlib.animation import FuncAnimation
from matplotlib.colors import PowerNorm

Expand Down Expand Up @@ -298,10 +297,7 @@ def update(frame):

# Create the animation and convert to a displayable video:
anim = FuncAnimation(fig, func=update, frames=10, interval=200)
plt.close(fig) # so it doesn't display here
video = anim.to_html5_video()
display.display(display.HTML(video))

plt.show()

######################################################################
# Using CameraDisplays interactively
Expand Down Expand Up @@ -381,10 +377,7 @@ def draw_sample(frame):


anim = FuncAnimation(fig, func=draw_sample, frames=n_samp, interval=100)
plt.close(fig) # so it doesn't display here
video = anim.to_html5_video()
display.display(display.HTML(video))

plt.show()

######################################################################
# Making it clickable
Expand Down

0 comments on commit e9c015a

Please sign in to comment.