Skip to content

Commit

Permalink
Match dot and ellipse colours
Browse files Browse the repository at this point in the history
  • Loading branch information
RiboRings committed Aug 28, 2023
1 parent 933feb2 commit 083502b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/plotCCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
# Plot based on the data
#' @importFrom ggrepel geom_text_repel geom_label_repel
.rda_plotter <- function(
plot_data, alpha = 0.2, vec_size = 0.25, vec_color = vec_colour,
plot_data, alpha = 0.2, ellipse_size = 0.1, vec_size = 0.25, vec_color = vec_colour,
vec_colour = "black", min.segment.length = 5, parse = TRUE, vec_text = TRUE, ellipse_fill = TRUE, ...){
# TODO: Ellipse: fill or just an edge? --> Edge line type?
# TODO: vector: vector line type, vector arrow size and line bulkiness
Expand All @@ -280,8 +280,9 @@ setMethod("plotRDA", signature = c(object = "SingleCellExperiment"),
if( ellipse_fill ){
plot <- plot +
stat_ellipse(data = data,
aes(x = .data[[xvar]], y = .data[[yvar]], fill = .data[[colour_var]]),
geom = "polygon", alpha = alpha)
aes(x = .data[[xvar]], y = .data[[yvar]],
color = .data[[colour_var]], fill = after_scale(color)),
geom = "polygon", alpha = alpha, size = ellipse_size)
} else{
plot <- plot +
stat_ellipse(data = data,
Expand Down

0 comments on commit 083502b

Please sign in to comment.