:py:mod:`src.plot` ================== .. py:module:: src.plot Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: src.plot.MidpointNormalize Functions ~~~~~~~~~ .. autoapisummary:: src.plot.hindcasts src.plot.metric_maps src.plot.metrics Attributes ~~~~~~~~~~ .. autoapisummary:: src.plot.PROJECT_DIR .. py:data:: PROJECT_DIR .. py:class:: MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False) Bases: :py:obj:`matplotlib.colors.Normalize` Midpoint normalised colorbar norm .. !! processed by numpydoc !! .. py:method:: __call__(value, clip=None) Normalize *value* data in the ``[vmin, vmax]`` interval into the ``[0.0, 1.0]`` interval and return it. :Parameters: **value** Data to normalize. **clip** : bool If ``None``, defaults to ``self.clip`` (which defaults to ``False``). .. rubric:: Notes If not already initialized, ``self.vmin`` and ``self.vmax`` are initialized using ``self.autoscale_None(value)``. .. !! processed by numpydoc !! .. py:function:: hindcasts(hcsts, obsvs=None, hists=None, shade=False, ax=None, figsize=(15, 4)) Plot sets of hindcasts. Where multiple variables are provided, it is assumed that all inputs contain the same variables. :Parameters: **hcsts** : dict Dictionary of hindcasts to plot with the format {"name": hcst}, where hcst is an xarray.Dataset with dimensions "init" and "lead" **obsvs** : dict, optional Dictionary of observations to plot with the format {"name": obsv}, where obsv is an xarray.Dataset with dimension "time" **hist** : dict, optional Dictionary of historical runs to plot with the format {"name": hist}, where hist is an xarray.Dataset with dimension "time" **shade** : bool, optional If True, shade background according to change in bias correction in CAFE60v1 .. !! processed by numpydoc !! .. py:function:: metric_maps(fields, variable, vrange, headings=None, add_colorbar=True, cbar_bounds=None, cmap='PiYG', central_longitude=180, figsize=(15, 15)) Plot panels of skill score maps :Parameters: **fields** : list List of size n_rows x n_columns containing the fields to plot **variable** : str The name of the variable **vrange** : iterable of length 2 The vmin and vmax values for all panels **headings** : list List of the same size as fields containing the headins for each panel **figsize** : iterable of length 2 The total size of the figure .. !! processed by numpydoc !! .. py:function:: metrics(metrics, variable, headings=None, one_legend=True, shade_background=True, figsize=(15, 15)) Plot panels of skill scores. When multiple metrics are provided in a panel, cross are shown along the x-axis where both metrics are positive. :Parameters: **metrics** : list List of size n_rows x n_columns containing dictionaries of the model metrics to plot in each panel, e.g. [[{"model1": {"rXY": metric1, "ri": metric2}, "model2": {"rXY": metric1, "ri": metric2}}]] **variable** : str The name of the variable **headings** : list List of the same size as fields containing the headins for each panel **one_legend** : boolean, optional If True, only add a legend to the first panel **shade_background** : boolean, optional Of True, shade the background either side of zero **figsize** : iterable of length 2 The total size of the figure .. !! processed by numpydoc !!