csep.plots.plot_comparison_test
- csep.plots.plot_comparison_test(results_t, results_w=None, percentile=95, ax=None, show=False, **kwargs)[source]
Plots a list of T-Test (and optional W-Test) results on a single axis.
Usage Tutorials
- Parameters:
results_t (list of EvaluationResult) – List of T-Test results.
results_w (list of EvaluationResult, optional) – List of W-Test results. If provided, they are plotted alongside the T-Test results. Defaults to None.
percentile (int, optional) – Percentile for coloring W-Test results. Defaults to 95.
ax (matplotlib.axes.Axes, optional) – Matplotlib axes object to plot on. If None, a new figure and axes are created. Defaults to None.
show (bool, optional) – If True, the plot is displayed after creation. Defaults to False.
**kwargs (optional) –
Additional keyword arguments for customizing the plot:
linewidth (float): Width of the error bars.
capsize (float): Size of the caps on the error bars.
markersize (float): Size of the markers.
xlabel_fontsize (int): Font size for the X-axis labels.
xlabel_rotation (int): Angle to rotate X-axis tick labels
ylabel (str): Label for the Y-axis. Defaults to ‘Information gain per earthquake’.
ylabel_fontsize (int): Font size for the Y-axis label.
title (str): Title of the plot. Defaults to the name of the first T-Test result.
ylim (tuple): Limits for the Y-axis.
grid (bool): Whether to display grid lines. Defaults to True.
hbars (bool): Whether to include horizontal bars for visual separation.
legend (bool): Automatic legend display.. Defaults to True.
legend_loc (‘int’, str): Location of the legend. Defaults to ‘best’.
legend_fontsize (int): Font size for the legend text.
legend_labelspacing (float): Vertical spacing between legend elements.
legend_borderpad (float): Padding between legend frame and elements.
legend_framealpha (float): Transparency value for the legend frame.
tight_layout (bool): Whether to use tight layout for the figure. Defaults to True.
- Returns:
The Matplotlib axes object containing the plot.
- Return type:
Changed in version 0.8.0: plot_args dictionary is only partially supported and will be removed in v1.0.0.
Added in version 0.8.0: Added legend option to automatically create legend