diagnostic.visualizations.plot_maps_mod_ref_diff#
- plot_maps_mod_ref_diff(da_mod: DataArray, da_ref: DataArray, da_diff: DataArray, region=None, **kwargs)[source]#
Plots side-by-side comparison maps for model data, reference data, and their difference.
- Parameters:
da_mod (xarray.DataArray) – The model data to be plotted. Expected to be a 2D array with latitude and longitude dimensions.
da_ref (xarray.DataArray) – The reference data to be plotted. Expected to be a 2D array with latitude and longitude dimensions.
da_diff (xarray.DataArray) – The difference between model and reference data (model - reference) to be plotted.
region (str, optional) – A string specifying the region for determining the plotting extent. Defaults to None.
**kwargs (dict, optional) –
Additional keyword arguments for customizing the plots:
vmin (float): Minimum value for the color scale of the model and reference plots.
vmax (float): Maximum value for the color scale of the model and reference plots.
vmin_bias (float): Minimum value for the color scale of the bias plot.
vmax_bias (float): Maximum value for the color scale of the bias plot.
- Returns:
A list containing the three axes objects for the model, reference, and bias plots.
- Return type:
list of matplotlib.axes._subplots.AxesSubplot
Notes
All warnings are suppressed during the execution of this function.
Each subplot uses the PlateCarree projection and includes borders and coastlines.
The color scale for the model and reference plots is determined by the combined minimum and maximum values
across both datasets unless explicitly specified via vmin and vmax. - The bias plot uses a diverging color map (‘coolwarm’) centered around zero, with its range determined by the maximum absolute value of the difference unless overridden by vmin_bias and vmax_bias. - Titles for the subplots are positioned to the right and are derived from the ‘dataset’ attribute of the respective data arrays, if available. Otherwise, default titles (“Model”, “Reference”, “Model - Reference”) are used. - The figure title is set to the ‘long_name’ attribute of the reference data, followed by its variable name.