Skip to content

Commit

Permalink
docs: update some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Feb 22, 2021
1 parent 048b1c3 commit 2b5e0e2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
33 changes: 17 additions & 16 deletions navis/plotting/dd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,30 @@ def plot2d(x: Union[core.NeuronObject,
Parameters
----------
x : TreeNeuron | MeshNeuron | NeuronList | Volume | Dotprops | np.ndarray
Objects to plot::
Objects to plot:
- multiple objects can be passed as list (see examples)
- numpy array of shape (n,3) is intepreted as points for scatter plots
- multiple objects can be passed as list (see examples)
- numpy array of shape (n,3) is intepreted as points for
scatter plots
method : '2d' | '3d' (default) | '3d_complex'
Method used to generate plot. Comes in three flavours:
1. '2d' uses normal matplotlib. Neurons are plotted on
top of one another in the order their are passed to
the function. Use the ``view`` parameter (below) to
set the view (default = xy).
2. '3d' uses matplotlib's 3D axis. Here, matplotlib
decide the depth order (zorder) of plotting. Can
change perspective either interacively or by code
(see examples).
3. '3d_complex' same as 3d but each neuron segment is
added individually. This allows for more complex
zorders to be rendered correctly. Slows down
rendering though.
1. '2d' uses normal matplotlib. Neurons are plotted on
top of one another in the order their are passed to
the function. Use the ``view`` parameter (below) to
set the view (default = xy).
2. '3d' uses matplotlib's 3D axis. Here, matplotlib
decide the depth order (zorder) of plotting. Can
change perspective either interacively or by code
(see examples).
3. '3d_complex' same as 3d but each neuron segment is
added individually. This allows for more complex
zorders to be rendered correctly. Slows down
rendering though.
soma : bool, default=True
Plot soma if one exists. Size of the soma is determined
by the neuron's ``.soma_radius`` property which defaults
to the "radius" column for ``TreeNeurons``.
to the "radius" column for ``TreeNeurons``.
connectors : bool, default=True
Plot connectors.
connectors_only : boolean, default=False
Expand Down
35 changes: 19 additions & 16 deletions navis/plotting/ddd.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def plot3d(x: Union[core.NeuronObject,
terminal: vispy used
Jupyter: plotly used
See ``backend`` parameter on how to change default behavior.
See ``backend`` parameter on how to overwrite this default behavior.
Parameters
----------
Expand All @@ -82,10 +82,14 @@ def plot3d(x: Union[core.NeuronObject,
Use ``dict`` to map colors to neurons:
``{uuid: (r, g, b), ...}``.
cn_colors : str | tuple | dict | "neuron"
Overrides the default colors::
- single color as str (e.g. ``'red'``) or rgb tuple (e.g. ``(1, 0, 0)``)
- dict mapping the connectors tables ``type`` column to a color (e.g. `{0: (1, 0, 0)}`)
- with "neuron", connectors will receive the same color as their neuron
Overrides the default colors:
- single color as str (e.g. ``'red'``) or rgb tuple (e.g.
``(1, 0, 0)``)
- dict mapping the connectors tables ``type`` column to a
color (e.g. `{0: (1, 0, 0)}`)
- with "neuron", connectors will receive the same color as
their neuron
palette : str | array | list of arrays, default=None
Name of a matplotlib or seaborn palette. If ``color`` is
not specified will pick colors from this palette.
Expand All @@ -108,17 +112,17 @@ def plot3d(x: Union[core.NeuronObject,
width/height : int, default=600
Use to define figure/window size.
scatter_kws : dict, optional
Use to modify scatter plots. Accepted parameters are
- ``size`` to adjust size of dots
- ``color`` to adjust color
soma : bool, default=True
Whether to plot soma if it exists (TreeNeurons only).
Size of the soma is determined by the neuron's
``.soma_radius`` property which defaults to the "radius"
column for ``TreeNeurons``.
Use to modify scatter plots. Accepted parameters are:
Plotly only
- ``size`` to adjust size of dots
- ``color`` to adjust color
soma : bool, default=True
Whether to plot soma if it exists (TreeNeurons only). Size
of the soma is determined by the neuron's ``.soma_radius``
property which defaults to the "radius" column for
``TreeNeurons``.
``Below parameters are for plotly backend only:``
fig : plotly.graph_objs.Figure
Pass to add graph objects to existing plotly figure. Will
not change layout.
Expand All @@ -138,8 +142,7 @@ def plot3d(x: Union[core.NeuronObject,
hover_id : bool, default=False
If True, hovering over skeleton nodes will show their ID.
Vispy only
``Below parameters are for vispy backend only:``
clear : bool, default = False
If True, will clear the viewer before adding the new
objects.
Expand Down

0 comments on commit 2b5e0e2

Please sign in to comment.