Skip to contents

Plots a B-spline design matrix using ggplot2, optionally applying log scales to the x or y axes. Each column of the matrix is treated as a separate basis function.

Usage

plot_bspline_basis_ggplot(
  omega,
  design_matrix,
  k = NULL,
  logx = FALSE,
  logy = FALSE
)

Arguments

omega

A numeric vector of input values at which the basis is evaluated.

design_matrix

A numeric matrix (rows = length of omega, columns = basis functions).

k

(Optional) The degree of the B-spline basis. Used only for labelling.

logx

Logical; if TRUE, plot the x-axis on a log10 scale.

logy

Logical; if TRUE, plot the y-axis on a log10 scale.

Value

A ggplot object displaying each basis function as a line.