plot_FC_gg: Plot FC with ggplot2

View source: R/plot_FC_gg.R

plot_FC_ggR Documentation

Plot FC with ggplot2

Description

Plot a FC matrix.

Usage

plot_FC_gg(
  mat,
  colFUN = NULL,
  title = "FC Matrix",
  legTitle = "FC",
  group_divs = NULL,
  group_cols = RColorBrewer::brewer.pal(8, "Set2"),
  y_labs = NULL,
  uppertri_means = TRUE,
  divColor = "black",
  lim = NULL,
  diagVal = 1
)

Arguments

mat

The FC matrix

colFUN

A scale_fill function. If NULL, use this default: function(limits=c(0,1), ...){viridis::scale_fill_viridis(option="inferno", limits=limits, ...)}

title

The plot title. Default: "FC Matrix".

legTitle

The legend title. Default: "FC".

group_divs, group_cols

Split the FC matrix into groups of contiguous rows/columns? Use group_divs to indicate the index of the first element in each group. For example, if the groups are 1-8, 9-15, and 16 to 25, set group_divs=c(1, 9, 16). Groups will be indicated by a color bar along the left and top sides of the plot. Use group_cols to change the colors. By default, group_divs is NULL (no groups).

y_labs

Labels to place along the y-axis? If is.null(group_divs), this should be a character vector labeling each row of mat, or a dot dot dot. If !is.null(group_divs), this may alternatively be a character vector labeling each group.

uppertri_means

Use the upper triangle of the FC matrix to show the mean of each group indicated by group_divs? Default: TRUE. Has no effect if group_divs is NULL.

divColor

Color of group dividers and outline of the FC matrix. Default: "black".

lim

Length-two numeric vector indicating the limits for the color bar. Values beyond lim will be clipped. If NULL (default), the limits will be set to the largest magnitude value in mat (no clipping).

diagVal

On-diagonal values will be set to this value. (uppertri_means are calculated before diagVal is used.)

Value

The plot


fMRItools documentation built on June 10, 2025, 9:09 a.m.