From 1b6d598441e322d79701af9beb19dbdc971f1bbb Mon Sep 17 00:00:00 2001 From: alexanderbates Date: Mon, 16 Sep 2024 11:48:57 -0400 Subject: [PATCH] Update ggplot2.R --- R/ggplot2.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/ggplot2.R b/R/ggplot2.R index 2f0b6c9..2b02025 100644 --- a/R/ggplot2.R +++ b/R/ggplot2.R @@ -10,6 +10,7 @@ #' @param neuron1.info Character, a vector to be printed on the outputted ggplot in reference to neuron1. #' @param neuron2.info Character, a vector to be printed on the outputted ggplot in reference to neuron2. #' @param neuron3.info Character, a vector to be printed on the outputted ggplot in reference to neuron3. +#' @param volume A mesh3d or hxsurf object in BANC space that you wish you co-plot. #' @param region Character, whether to plot the brain area, VNC area or both (default). #' @param banc_brain_neuropil A mesh object representing the brain neuropil. Default is banc_brain_neuropil.surf. #' @param banc_vnc_neuropil A mesh object representing the ventral nerve cord (VNC) neuropil. Default is banc_vnc_neuropil.surf. @@ -60,6 +61,7 @@ banc_neuron_comparison_plot <- function(neuron1 = NULL, neuron1.info = NULL, neuron2.info = NULL, neuron3.info = NULL, + volume = NULL, region = c("both","brain","vnc"), banc_brain_neuropil = NULL, banc_vnc_neuropil = NULL, @@ -155,6 +157,7 @@ banc_neuron_comparison_plot <- function(neuron1 = NULL, # Create the plot p <- ggplot2::ggplot() + geom_neuron(x = mesh, rotation_matrix = rotation_matrix, alpha = 0.05, cols = c("grey90", "grey50")) + + geom_neuron(x = volume, rotation_matrix = rotation_matrix, alpha = 0.05, cols = c("grey30")) + geom_neuron(x=neuron_pruned1, rotation_matrix = rotation_matrix, cols = cols1, alpha = alpha[1], linewidth = 0.3) + geom_neuron(x=neuron_pruned2, rotation_matrix = rotation_matrix, cols = cols2, alpha = alpha[2], linewidth = 0.3) + geom_neuron(x=neuron_pruned3, rotation_matrix = rotation_matrix, cols = cols3, alpha = alpha[3], linewidth = 0.3) +