visualise_spatial_statistic#

visualise_spatial_statistic(radii, statistic_values, statistic_to_plot=None, confidence_intervals=None, y_label=None, ax=None, line_label_name=None, line_kwargs={}, shape_kwargs={}, figure_kwargs={})#

Visualise the PCF, J-function, K function, or L function

Parameters:
radiiarray-like

Array of radii values.

statistic_valuesarray-like

Array of statistic values corresponding to the radii.

statistic_to_plotstr, optional

If ‘K’, ‘L’, ‘PCF’, or ‘J’, the graph will include a line showing the expected “null” value of the relevant function. Defaults to None.

confidence_intervalsarray-like, optional

Array of the upper and lower confidence intervals for the statistic values. Should be of shape (n, 2) where n is the length of radii.

y_labelstr, optional

Specify the y-axis label of the plot (note that as a pyplot plot, the axes labels can easily be altered after plotting using standard pyplot syntax.). If None, deafults to “value”, unless statistic_to_plot is specified in which case method-specific default labels will be used.

axmatplotlib.axes.Axes, optional

Matplotlib Axes object to plot on. If None, a new figure and axes will be created.

line_label_namestr, optional

Label for the line plot.

line_kwargsdict, optional

Additional keyword arguments to pass to the line plot.

shape_kwargsdict, optional

Additional keyword arguments to pass to the fill_between function for confidence intervals.

figure_kwargsdict, optional

Additional keyword arguments to pass to the figure creation.

Returns:
figmatplotlib.figure.Figure

The matplotlib figure object.

axmatplotlib.axes.Axes

The matplotlib axes object.

Notes

The function will plot the statistic values values against the radii, optionally including confidence intervals. A horizontal line at y=1 is added to indicate the null hypothesis.