This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
WorkoutAnimation
marcjulianschwarz edited this page Feb 19, 2022
·
2 revisions
class watchlib.animation.WorkoutAnimation(data, config)
You can use WorkoutAnimation
to create 3D animated plots of your WorkoutRoute. See WorkoutAnimationConfig for more details on customizing the animation.
- data : WorkoutRoute
- config : WorkoutAnimationConfig
You can animate a WorkoutRoute using the animate()
method.
Returns:
matplotlib.animation.FuncAnimation
Usage:
from watchlib.data_handler import DataLoader
from watchlib.animation import WorkoutAnimation
dl = DataLoader("path/to/apple_health_export")
routes = dl.load_routes()
wa = WorkoutAnimation(route=routes[0])
animation = wa.animate()
animation.save("route_animation.mp4")
You can set a new configuration using the set_config()
method.
Parameters:
-
config
: WorkoutAnimationConfig
Usage:
from watchlib.animation import WorkoutAnimation, WorkoutAnimationConfig
config = WorkoutAnimationConfig(
fig_size=(10,10),
color_on="elevation"
)
wa = WorkoutAnimation(route=route, config=config)
Of course you can always change the WorkoutAnimationConfig like this:
wa = WorkoutAnimation(route=route)
wa.config.fig_size = (10,10)
wa.config.color_on = "elevation"