Skip to content

Commit

Permalink
Updated ggplot2 related documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbates committed Jul 23, 2024
1 parent ae03e02 commit aafc80d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 36 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ S3method(ggplot2_neuron_path,neuron)
S3method(ggplot2_neuron_path,neuronlist)
export(banc_all_synapses)
export(banc_backbone_proofread)
export(banc_brain_side_view)
export(banc_cave_client)
export(banc_cave_query)
export(banc_cave_tables)
Expand Down Expand Up @@ -58,6 +59,7 @@ export(banc_side_view)
export(banc_to_JRC2018F)
export(banc_upload_mesh)
export(banc_view)
export(banc_vnc_side_view)
export(banc_vnc_view)
export(banc_voxdims)
export(banc_xyz2id)
Expand Down
19 changes: 13 additions & 6 deletions R/ggplot2.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
#' dna02 <- nat::nlapply(dna02,Rvcg::vcgQEdecim,percent = 0.1)
#'
#' # Make plot!
#' banc_neuron_comparison_plot(dna01, dna02, filename = "neuron_comparison.png")
#' banc_neuron_comparison_plot(dna01, dna02, neuron1.info = "DNa01",
#' neuron2.info = "DNa02",
#' filename = "neuron_comparison.png")
#' }
#'
#' @export
Expand All @@ -58,7 +60,7 @@ banc_neuron_comparison_plot <- function(neuron1,
neuron1.info = NULL,
neuron2.info = NULL,
neuron3.info = NULL,
region = c("both","brain","vinc"),
region = c("both","brain","vnc"),
banc_brain_neuropil = NULL,
banc_vnc_neuropil = NULL,
banc_neuropil = NULL,
Expand Down Expand Up @@ -97,10 +99,15 @@ banc_neuron_comparison_plot <- function(neuron1,
}else if(view%in%c("vnc","vnc_side")){
mesh <- banc_vnc_neuropil
decaptitate <- "vnc"
if(grepl("side")){
title.col <- "firebrick"
}else{
title.col <- "blue"
}
}else if (view=="main"){
mesh <- banc_neuropil
decaptitate <- "none"
title.col <- "darkturquoise"
title.col <- "blue"
}else if (view=="side"){
mesh <- banc_neuropil
decaptitate <- "none"
Expand Down Expand Up @@ -165,9 +172,9 @@ banc_neuron_comparison_plot <- function(neuron1,
panel.border = ggplot2::element_blank(),
panel.background = ggplot2::element_blank(), #gplot2::element_rect(fill = "grey95", color = NA),
plot.background = ggplot2::element_blank()) + #gplot2::element_rect(fill = "grey95", color = NA))
if(view=="main"){
if(view%in%c("front")){
ggplot2::labs(title = neuron1.info)
}else if (view=="side"){
}else if (view%in%c("vnc","brain_side","vnc_side")){
ggplot2::labs(title = neuron2.info)
}else{
ggplot2::labs(title = "")
Expand All @@ -179,7 +186,7 @@ banc_neuron_comparison_plot <- function(neuron1,

# Arrange
if(region=="both"){
ga <- ggpubr::ggarrange(glist[["main"]], glist[["side"]], glist[["front"]], glist[["vnc"]],
ga <- ggpubr::ggarrange(glist[["front"]], glist[["vnc"]], glist[["main"]], glist[["side"]],
heights = c(1, 1, 1, 1), widths = c(1, 1, 1, 1),
ncol = 2, nrow = 2) +
ggplot2::theme(plot.margin = ggplot2::margin(0,0,0,0, "cm"))
Expand Down
20 changes: 19 additions & 1 deletion man/banc_neuron_comparison_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/banc_view.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 12 additions & 23 deletions man/geom_neuron.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions man/ggneuron.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aafc80d

Please sign in to comment.