R/neuron-plot.R
Plot neurons in 3D using rgl library
# S3 method for neuron plot3d(x, WithLine = TRUE, NeuronNames = FALSE, WithNodes = TRUE, WithAllPoints = FALSE, WithText = FALSE, PlotSubTrees = TRUE, add = TRUE, col = NULL, soma = FALSE, ...)
x | A neuron to plot |
---|---|
WithLine | Whether to plot lines for all segments in neuron |
NeuronNames | Logical indicating whether to label the neuron in the plot using the NeuronName field or a character vector of names. |
WithNodes | Whether to plot dots for branch and end points |
WithAllPoints | Whether to plot dots for all points in the neuron |
WithText | Whether to label plotted points with their numeric id (see details) |
PlotSubTrees | Whether to plot all sub trees when the neuron is not fully connected. |
add | Whether to add the neuron to existing rgl plot rather than clearing the scene (default TRUE) |
col | Colour specification (see rgl materials) |
soma | Whether to plot a sphere at neuron's origin representing the
soma. Either a logical value or a numeric indicating the radius (default
|
... | Additional arguments passed to |
list of rgl plotting ids (invisibly) separated into lines
,
points
, texts
according to plot element. See
rgl::plot3d
for details.
Note that when WithText=TRUE
, the numeric identifiers plotted
are raw indices into the x$d
array of the neuron
,
not the values of the PointNo
column.
Note that ...
is passed to both lines3d
and
spheres3d
(if somata are being plotted). Not all
...
elements are necessarily relevant to both of these drawing
calls. Furthermore plotting a large number of somata with transparency
(i.e. alpha < 1
) can quickly result in very slow rgl draw and
refresh speeds; you will likely want to set skipRedraw=FALSE
when using
plot3d.neuronlist
to plot a collection of neurons.
plot3d.neuronlist
, plot3d.dotprops
,
nat::plot3d
, rgl::plot3d
# A new plot would have been opened if required open3d()#> glX #> 7