Skip to content

Commit

Permalink
add plot
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-marsh committed Jun 12, 2024
1 parent 63826e0 commit ab6226c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion R/LIGER_Plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ Factor_Cor_Plot <- function(
plot_title = NULL,
plot_type = "full",
x_lab_rotate = TRUE,
cluster = TRUE
cluster = TRUE,
cluster_rect = FALSE,
cluster_rect_num = NULL,
cluster_rect_col = "white"
) {
# check plot type
if (!plot_type %in% c("full", "lower", "upper")) {
Expand Down Expand Up @@ -449,6 +452,12 @@ Factor_Cor_Plot <- function(
plot <- plot + RotatedAxis()
}

if (isTRUE(x = cluster_rect)) {
rect_list <- create_factor_hclust_rect(cor_mat = cor_mat, num_rect = cluster_rect_num, num_factors = length(x = factor_names))

plot <- plot + annotate(geom = "rect", xmin = rect_list[[1]][,1], xmax = rect_list[[1]][,2], ymin = rect_list[[2]][,1], ymax = rect_list[[2]][,2], fill = NA, color = cluster_rect_col)
}

# return plot
return(plot)
}
5 changes: 4 additions & 1 deletion man/Factor_Cor_Plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab6226c

Please sign in to comment.