From c2acf766e0332848677c80f1a174647f41600ec1 Mon Sep 17 00:00:00 2001 From: zhanghao-njmu <542370159@qq.com> Date: Sat, 25 Nov 2023 16:24:04 +0800 Subject: [PATCH] Change the number of bins in dot plot for the FeatureStatPlot function --- R/SCP-plot.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/SCP-plot.R b/R/SCP-plot.R index 771bdf87..fb2cfc40 100644 --- a/R/SCP-plot.R +++ b/R/SCP-plot.R @@ -4183,7 +4183,7 @@ ExpressionStatPlot <- function(exp.data, meta.data, stat.by, group.by = NULL, sp y_min_use <- layer_scales(p)$y$range$range[1] } if (plot_type == "dot") { - bins <- cut(dat$value, breaks = seq(y_min_use, y_max_use, length.out = 15), include.lowest = TRUE) + bins <- cut(dat$value, breaks = seq(y_min_use, y_max_use, length.out = 10), include.lowest = TRUE) bins_median <- sapply(strsplit(levels(bins), ","), function(x) median(as.numeric(gsub("\\(|\\)|\\[|\\]", "", x)), na.rm = TRUE)) names(bins_median) <- levels(bins) dat[["bins"]] <- bins_median[bins]