geodata.plot.time_series
========================

.. py:function:: geodata.plot.time_series(ds: xarray.DataArray, lat_slice: Optional[CoordinateType] = None, lon_slice: Optional[CoordinateType] = None, agg_slice: bool = True, agg_slice_method: ReductionType = 'mean', coord_dict: Optional[dict[str, CoordinateType]] = None, time_factor: float = 1.0, agg_time_method: ReductionType = 'mean', figsize: tuple[float, float] = (10.0, 5.0), ds_name: Optional[str] = None, loc_name: Optional[str] = None, title: Optional[str] = None, title_size: float = 12.0, grid: bool = True, legend: bool = True, return_fig: bool = False, **kwargs) -> Optional[matplotlib.pyplot.Figure]

   Take in the xarray.DataArray, slice of latitude or longitude,
   plot the time series. When users give lat or lon slices, the values can be mean/sum aggregated.
   Users can also provide a dictionary of name-coordinate pairs instead of lat and lon input.
   By default, the method shows the time series' aggregated mean.

   :param ds: The target xarray.DataArray object.
   :type ds: xr.DataArray
   :param lat_slice: The slice of latitude values.
   :type lat_slice: tuple
   :param lon_slice: The slice of longitude values
   :type lon_slice: tuple
   :param agg_slice: Whether the program plot the aggregate values from the slices
   :type agg_slice: bool
   :param agg_slice_method: Reduction method for aggregating the spatial slices. This can be either
                            "mean" or "sum".
   :type agg_slice_method: str
   :param coord_dict: The (Name, Coordinate) pair of different locations;
                      An example: `{'Beijing': (40, 116.25), 'Shanghai': (31, 121.25)}`
   :type coord_dict: dict
   :param time_factor: The factor to aggregate the value of dataArray on
                       An example: for daily mean on hourly data, time_factor = 24
   :type time_factor: float
   :param agg_time_method: Reduction method for time dimension. This can be either "mean" or "sum".
   :type agg_time_method: str
   :param figsize: The size of the plot
   :type figsize: tuple
   :param ds_name: Name of the DataArray to be shown on title
   :type ds_name: str
   :param loc_name: Location of the place to be shown on title
   :type loc_name: str
   :param title: The title of the result plot
   :type title: str
   :param title_size: The size of the title of the result plolt
   :type title_size: float
   :param grid: Whether to add grid lines to the plot, True by default
   :type grid: bool
   :param legend: Add legend to the plot if multiple locations are provided, True by default
   :type legend: bool
   :param return_fig: Whether to return the figure or not. True by default
   :type return_fig: bool
   :param \*\*kwargs: Other keyword arguments for xarray.DataArray.plot()

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

   :raises NotImplementedError: If the reduction method is not supported.

