geodata.plot.heatmap
====================

.. py:function:: geodata.plot.heatmap(ds: xarray.DataArray, t: Optional[Union[int, str]] = None, agg_method: ReductionType = 'mean', shape: Optional[geopandas.GeoSeries] = None, shape_width: float = 0.5, shape_color: str = 'black', map_type: Literal['contour', 'colormesh'] = 'colormesh', cmap: str = 'bone_r', figsize: tuple[float, float] = (10.0, 6.0), title: Optional[str] = None, title_size: float = 12, grid: bool = True, return_fig: bool = False, **kwargs) -> Optional[matplotlib.pyplot.Figure]

   Take an xarray.DataArray and a time index or string, plot contour/colormesh map for its values.

   :param ds: The target DataArray object.
   :type ds: xr.DataArray
   :param t: Target timestamp. This could either a numeric time index,
             or a time string from the xarray.DataArray time dimension.
   :type t: Optional[Union[int, str]]
   :param agg_method: Aggregation method in the time dimension.
                      This is used if t was not not provided. Options can either be mean aggregation or sum aggregation.
   :type agg_method: Literal["mean", "sum"]
   :param shape: Shapes to be plotted over the raster.
   :type shape: geopandas.GeoSeries
   :param shape_width: Width of lines 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 map_type: Map type. This can either be "contour" or "colormesh".
   :type map_type: Literal["contour", "colormesh"]
   :param cmap: The color of the heat map, select one from matplotlib.pyplot.colormaps.
   :type cmap: str
   :param figsize: The size of the plot.
   :type figsize: tuple
   :param title: The title of the result plot. Optional. If not provided, the title will be
                 automatically generated.
   :type title: Optional[str]
   :param title_size: The size of the title of the result plot. 12 by default.
   :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 return_fig: Whether to return the plt.Figure object. True by default
   :type return_fig: bool
   :param \*\*kwargs: Additional arguments for xarray.DataArray.plot.pcolormesh or
                      xarray.DataArray.plot.contourf, depending on selected `map_type`.

   :returns: The figure object if `return_fig` is True.
   :rtype: Optional[plt.Figure]

   :raises ValueError: If the map type is not supported.

