From 4b990a827d698b55754b7ac3832e333c6332a2fa Mon Sep 17 00:00:00 2001 From: dialvarez Date: Tue, 4 Mar 2025 10:41:33 -0600 Subject: [PATCH] Do not add line to combination matrix if line.size == 0 --- R/Matrix.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/Matrix.R b/R/Matrix.R index b828672..a36b3b0 100644 --- a/R/Matrix.R +++ b/R/Matrix.R @@ -104,9 +104,13 @@ Make_matrix_plot <- function(Mat_data,Set_size_data, Main_bar_data, point_size, fill = shading_data$shade_color, alpha = shade_alpha) + geom_point(data= Mat_data, aes_string(x= "x", y= "y"), colour = Mat_data$color, size= point_size, alpha = Mat_data$alpha, shape=16) - + geom_line(data= Mat_data, aes_string(group = "Intersection", x="x", y="y", - colour = "color"), size = line_size) + scale_color_identity()) + # add line conditionally + if(line_size > 0) { + Matrix_plot <- Matrix_plot + + geom_line(data= Mat_data, aes_string(group = "Intersection", x="x", y="y", + colour = "color"), size = line_size) + } Matrix_plot <- ggplot_gtable(ggplot_build(Matrix_plot)) return(Matrix_plot) }