Skip to contents

This function creates a ggplot-based visualization that overlays multiple prediction grids on a single plot. Each grid represents a model's prediction and is distinguished by color. The function supports various axis scaling methods (Linear, Log10, Arcsinh), and optionally overlays population labels based on an intensity matrix.

Usage

PredIsobandPlotMulti(
  grid_list,
  x_label = "X",
  y_label = "Y",
  x_scale = "Linear",
  y_scale = "Linear",
  x_cofactor = 5,
  y_cofactor = 5,
  x_min = NULL,
  x_max = NULL,
  y_min = NULL,
  y_max = NULL,
  mode = "Pseudo-color",
  legend_show = TRUE,
  label_population = NA,
  intensity_matrix = NA
)

Arguments

grid_list

A named list of data frames, each containing columns x, y, and z. Each data frame represents a prediction grid for a model.

x_label

A character string for the x-axis label.

y_label

A character string for the y-axis label.

x_scale

A character string specifying the x-axis scale. Must be one of "Linear", "Log10", or "Arcsinh".

y_scale

A character string specifying the y-axis scale. Must be one of "Linear", "Log10", or "Arcsinh".

x_cofactor

A numeric value used for Arcsinh transformation on the x-axis. Ignored for other scales.

y_cofactor

A numeric value used for Arcsinh transformation on the y-axis. Ignored for other scales.

x_min

Minimum value for the x-axis.

x_max

Maximum value for the x-axis.

y_min

Minimum value for the y-axis.

y_max

Maximum value for the y-axis.

mode

A character string specifying the plot mode. Must be either "Contour line" or "Pseudo-color".

legend_show

Logical; whether to show the legend. Default is TRUE.

label_population

Optional character vector specifying population names to label on the plot.

intensity_matrix

Optional matrix or data frame containing intensity values for labeling populations. Must include rows named by x_label and y_label.

Value

A ggplot object representing the combined prediction plot.

Examples

if (FALSE) { # \dontrun{
PredIsobandPlotMulti(grid_list,
                     x_label = "X", y_label = "Y",
                     x_scale = "Linear", y_scale = "Linear",
                     x_min = 0, x_max = 1000,
                     y_min = 0, y_max = 1000,
                     mode = "Pseudo-color")
} # }