Why Animate#
Here are some reasons you may want to use ahlive to animate your data to life!
add dimension#
Data can be mapped to color, and also time!
[1]:
import ahlive as ah
import xarray as xr
ds = xr.tutorial.open_dataset("air_temperature")
ds["month"] = ds["time"].dt.strftime("%m - %b")
ds = ds.groupby("month").mean()
ds_kcmi = ds["air"].sel(lon=-88.5 + 360, lat=40, method="nearest")
tmpf_inline = ds_kcmi * 1.8 - 459.67
ah.Dataset(
ds,
xs="lon",
ys="lat",
cs="air",
state_labels="month",
title="2013-2014 Monthly Averaged Temperatures",
projection="LambertConformal",
coastline=True,
revert="boomerang",
fps=10
).reference(
x0s=[-88.5] * 12, # help wanted to simplify this method!
y0s=[40] * 12,
inline_labels=tmpf_inline
).config(**{
"ref_inline": dict(suffix="°F", color="black"),
"ref_plot": dict(color="black"),
"state": dict(color="black")
}).render()
[1]: