geodata.plot.heatmap_animation
==============================

.. py:function:: geodata.plot.heatmap_animation(ds: xarray.DataArray, time_factor: float = 1, agg_method: ReductionType = 'mean', shape: Optional[geopandas.GeoSeries] = None, shape_width: float = 0.5, shape_color: str = 'black', cmap: str = 'bone_r', v_max: Optional[float] = None, ds_name: Optional[str] = None, figsize: tuple[float, float] = (10, 5), title: Optional[str] = None, title_size: float = 12, grid: bool = True, **kwargs)

   Created animated version of `colormesh` so users can see the value change over time
   at default, each frame is the average or sum of value per time_unit * time_factor.

   :param ds: The target DataArray object.
   :type ds: xarray.DataArray
   :param time_factor: Tthe factor to aggregate the value of DataArray on
                       Example: for daily mean on hourly data, time_factor = 24. Defaults to 1.
   :type time_factor: float
   :param agg_method: Aggregation method. Can be either `mean` or `sum`.
   :type agg_method: str
   :param shape: Shapes to be plotted over the raster.
   :type shape: geopandas.GeoSeries
   :param shape_width: The line width for plotting shapes. 0.5 by default.
   :type shape_width: float
   :param shape_color: Color of the shape line. Black by default.
   :type shape_color: str
   :param cmap: The color of the heat map, select one from matplotlib.pyplot.colormaps.
   :type cmap: str
   :param v_max: The maximum value in the heatmap.
   :type v_max: float
   :param ds_name: Name of the DataArray to be shown on title.
   :type ds_name: str
   :param figsize: The size of the plot. (10, 5) by default.
   :type figsize: tuple
   :param title: The title of the result plot. Optional. If not provided, the title will be
                 automatically generated.
   :type title: str
   :param title_size: The size of the title of the result plot.
   :type title_size: float
   :param coastlines: Whether to add coast lines to the plot, True by default.
   :type coastlines: bool
   :param grid: Whether to add grid lines to the plot, True by default.
   :type grid: bool
   :param \*\*kwargs: Additional arguments for xarray.DataArray.plot.imshow.
   :type \*\*kwargs: dict

   :returns: The animation object.
   :rtype: matplotlib.animation.FuncAnimation

   :raises ValueError: If the DataArray does not contain the time dimension.
   :raises ValueError: If the colormap is not supported.
   :raises NotImplementedError: If the aggregation method is not supported.

