This function creates a complete ggplot2 visualization for neuron objects, including 'neuron', 'neuronlist', 'mesh3d', and 'hxsurf' objects. It sets up a minimal theme and applies consistent styling to the plot.
Arguments
- x
A 'neuron', 'neuronlist', 'mesh3d', or 'hxsurf' object to be visualized.
- volume
a brain/neuropil volume to be plotted in grey, for context. Defaults to NULL, no volume plotted.
- info
Optional. A string to be used as the plot title.
- rotation_matrix
An optional 4x4 rotation matrix to apply to the neuron coordinates.
- cols1
Color for the lowest Z values. Default is "turquoise".
- cols2
Color for the highest Z values. Default is "navy".
- alpha
Transparency of the neuron visualization. Default is 0.5.
- title.col
Color of the plot title. Default is "darkgrey".
- ...
Additional arguments passed to geom_neuron().
Details
This function wraps around geom_neuron() to create a complete plot with a consistent, minimal theme. It removes axes, legends, and other extraneous elements to focus on the neuron visualization itself.
See also
geom_neuron
for the underlying geom used in this function.
Examples
if (FALSE) { # \dontrun{
# Visualize the banc volume
ggneuron(banc_neuropil.surf, banc.surf)
# Visualize the banc brain neuropil
ggneuron(banc_neuropil.surf,
rotation_matrix = bancr:::banc_rotation_matrices[["front"]])
# See constituents of a neuronlist
ggneuron(nat::Cell07PNs, volume = nat::MBL.surf,
root = 10, high = "red", low = "black")
} # }