ESMBenchmarkViz.taylor_diagram
- ESMBenchmarkViz.taylor_diagram(std_devs, correlations, names, refstd, title='Interactive Taylor Diagram', normalize=False, step=0.2, show_reference=True, reference_name='Reference', reference_image=None, colormap='Spectral', width=600, show_plot=True, images=None, debug=False)[source]
Creates an interactive Taylor diagram using Bokeh.
The Taylor diagram visually represents the relationship between the standard deviation and correlation of different models against a reference model. This function allows for the comparison of multiple models based on their standard deviations and correlations to a specified reference standard deviation.
- Parameters:
std_devs (
list
ornp.ndarray
) – A list of standard deviations of the models being compared.correlations (
list
ornp.ndarray
) – A list of correlation coefficients of the models with respect to the reference model.names (
list
ofstr
) – A list of names for the models being compared, used for labeling in the plot.refstd (
float
) – The standard deviation of the reference model, used for calculating RMSE and for normalization if applicable.title (
str
, optional) – The title of the plot (default is “Interactive Taylor Diagram”).normalize (
bool
, optional) – If True, the standard deviations are normalized by the reference standard deviation (default is False).step (
float
, optional) – The step size for the arcs and grid lines in the Taylor diagram (default is 0.2).show_reference (
bool
, optional) – If True, the reference point is shown in the Taylor diagram (default is True).reference_name (
str
, optional) – The name of the reference dataset (default is “Reference”).reference_image (
str
, optional) – The path to an image file to be used as the reference image (default is None).colormap (
str
orlist
, optional) – A name of the Matplotlib or list of colors to use for the model points. Available names of Matplotlib colormap can be found here. Default is Spectral.width (
int
, optional) – The width of the plot in pixels (default is 600). Note that height will be set to equal as width for a Taylor Diagram. If images is provided, 2 times of the given width is going to be total width to show diagnostic image display panel on the right of the Taylor Diagram.show_plot (
bool
, optional) – If True, the plot will be displayed in the workflow (default is True).images (
str
, optional) – A list of image paths to be displayed on the plot. The images will be placed at the data points of the models.debug (
bool
, optional) – If True, prints additional debugging information (default is False).
- Returns:
bokeh.plotting.Figure
– Bokeh figure object containing the interactive Taylor diagram.
Example
>>> from ESMBenchmarkViz import taylor_diagram >>> std_devs = [0.8, 1.0, 1.2] # Standard deviations of models >>> correlations = [0.9, 0.85, 0.7] # Correlation coefficients >>> names = ["Model A", "Model B", "Model C"] # Names of models >>> refstd = 1.0 # Standard deviation of reference model >>> taylor_diagram(std_devs, correlations, names, refstd)
Example use case can be found here.
Notes
The Taylor diagram is a polar plot where the radial distance represents the standard deviation and the azimuthal angle represents the correlation coefficient. The reference standard deviation is used as a reference point for the radial distance. The correlation coefficient is represented by the angle between the model point and the reference point. The RMSE (Root Mean Square Error) is calculated as the distance between the model point and the reference point.
2024-10-04: Jiwoo Lee, initial version