spine.vis.cylinder
Module to draw cylinders.
Functions
|
Draw a cylinder centered at a given position. |
|
Function which produces a list of plotly traces of cylinders given a list of centroids and one shared or per-cylinder geometric description. |
- spine.vis.cylinder.cylinder_trace(centroid: ndarray, axis: ndarray, height: float, diameter: float, num_samples: int = 10, color: bool | int | float | generic | str | Sequence[bool | int | float | generic | str] | ndarray | None = None, intensity: bool | int | float | generic | Sequence[bool | int | float | generic] | ndarray | None = None, hovertext: bool | int | float | generic | str | Sequence[bool | int | float | generic | str] | ndarray | None = None, showscale: bool = False, **kwargs: Any) plotly.graph_objs.Mesh3d[source]
Draw a cylinder centered at a given position.
- Parameters:
centroid (np.ndarray) –
Centroid of the cylinder
axis (np.ndarray) –
Axis direction of the cylinder
height (float) – Height of the cylinder
diameter (float) – Diameter of the cylinder
num_samples (int, default 10) – Number of points sampled along theta and h in the cylindrical coordinate system of the cylinder. A larger number increases the resolution.
color (Union[str, int, float, Sequence], optional) – Color of the cylinder. Can be a single Plotly color or numeric value.
intensity (Union[int, float, Sequence], optional) – Color intensity of the cylinder along the colorscale axis. Can be a single numeric value or a per-vertex sequence.
hovertext (Union[int, float, str, Sequence], optional) – Text associated with the cylinder. Can be a scalar label or a per-vertex sequence of labels.
showscale (bool, default False) – If True, show the colorscale of the
plotly.graph_objs.Mesh3d**kwargs (dict, optional) – Additional parameters to pass to the underlying
plotly.graph_objs.Mesh3dobject
- spine.vis.cylinder.cylinder_traces(centroids: ndarray, axis: ndarray, height: bool | int | float | generic | Sequence[bool | int | float | generic] | ndarray, diameter: bool | int | float | generic | Sequence[bool | int | float | generic] | ndarray, color: bool | int | float | generic | str | Sequence[bool | int | float | generic | str] | ndarray | None = None, hovertext: bool | int | float | generic | str | Sequence[bool | int | float | generic | str] | ndarray | None = None, cmin: float | None = None, cmax: float | None = None, shared_legend: bool = True, legendgroup: str | None = None, showlegend: bool = True, name: str | None = None, **kwargs: Any) list[plotly.graph_objs.Mesh3d][source]
Function which produces a list of plotly traces of cylinders given a list of centroids and one shared or per-cylinder geometric description.
- Parameters:
centroids (np.ndarray) – (N, 3) Positions of each of the cylinder centroids
axis (np.ndarray) – (3,) or (N, 3) Axis direction of the cylinders
height (Union[int, float, Sequence]) – Height of the cylinders, either as one shared value or one value per cylinder.
diameter (Union[int, float, Sequence]) – Diameter of the cylinders, either as one shared value or one value per cylinder.
color (Union[str, int, float, Sequence], optional) – Color of the cylinders, either as one shared value or one value per cylinder.
hovertext (Union[int, float, str, Sequence], optional) – Text associated with the cylinders, either as one shared label or one label per cylinder.
cmin (float, optional) – Minimum value along the color scale
cmax (float, optional) – Maximum value along the color scale
shared_legend (bool, default True) – If True, the plotly legend of all ellipsoids is shared as one
legendgroup (str, optional) – Legend group to be shared between all cylinders
showlegend (bool, default True) – Whether to show legends on not
name (str, optional) – Name of the trace(s)
**kwargs (dict, optional) – List of additional arguments to pass to the underlying list of
plotly.graph_objs.Mesh3D
- Returns:
Cylinder traces
- Return type:
Union[List[plotly.graph_objs.Mesh3D]]