covariates_factor_scatter

covariates_factor_scatter#

mofaflex.pl.covariates_factor_scatter(model, factor, groups=None, covariate_dims=None, color=None, shape=None, size=1, figsize=(6, 6))#

Plot a factor against one or two covariate dimensions.

Parameters:
  • model (MOFAFLEX) – A MOFA-FLEX model.

  • factor (int | str) – The factor to plot.

  • groups (str | Sequence[str] | None (default: None)) – The groups to plot. If None, all groups with covariates are shown.

  • covariate_dims (int | str | Sequence[int] | Sequence[str] | None (default: None)) – The dimensions of the covariates to plot against. If a list of length 1, plot covariate on the x-axis and factor on the y-axis. If a list of length 2, plot the first covariate on the x-axis, the second covariate on the y-axis, and factor as color. If None, use all dimensions.

  • color (int | str | None (default: None)) – The factor or covariate to color by. Only used when one covariate dimension is plotted.

  • shape (str | None (default: None)) – The covariate name to shape by.

  • size (float (default: 1)) – Size of the data points.

  • figsize (tuple[float, float] (default: (6, 6))) – Figure size in inches.

Return type:

plotnine.ggplot