Skip to content

Commit 96c27cf

Browse files
committed
fix(ClonalLengthPlot): adjust quantile breaks calculation for bar plot
- Updated quantile breaks to use the range of data lengths instead of just the data directly. - Ensured that the breaks are unname'd for consistency in plotting.
1 parent c2f2ffa commit 96c27cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/clonalcompositionplot.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,13 @@ ClonalLengthPlot <- function(
330330
args$ylab <- ylab %||% default_ylab
331331
args$theme_args <- args$theme_args %||% list()
332332
args$theme_args$panel.grid.major.x <- element_blank()
333-
breaks <- unname(quantile(data$length, probs = seq(0, 1, length.out = x_nbreaks), type = 3))
333+
breaks <- unname(
334+
quantile(
335+
min(data$length, na.rm = TRUE):max(data$length, na.rm = TRUE),
336+
probs = seq(0, 1, length.out = x_nbreaks),
337+
type = 3
338+
)
339+
)
334340
if (is.null(args$split_by)) {
335341
suppressMessages({
336342
do.call(BarPlot, args) + scale_x_discrete(breaks = breaks)

0 commit comments

Comments
 (0)