From c80d98e3c0d91733669cacfb16b83eff0cbbd1c6 Mon Sep 17 00:00:00 2001 From: alexanderbates Date: Fri, 9 Aug 2024 14:45:51 -0400 Subject: [PATCH] Update ggplot2.R --- R/ggplot2.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/ggplot2.R b/R/ggplot2.R index 3e94976..df2b167 100644 --- a/R/ggplot2.R +++ b/R/ggplot2.R @@ -801,6 +801,10 @@ ggneuron <- function(x, } prune_vertices.synapticneuron <- function (x, verticestoprune, invert = FALSE, ...){ + if(length(verticestoprune)==nrow(x$d)){ + warning('no points left after pruning') + return(NULL) + } soma <- catmaid::somaid(x) if(!is.null(soma)&&!is.na(soma)){ x$d[catmaid::somaindex(x),"Label"] <- 1