sphere3d#
- QuadratiK.tools.sphere3d(x: ndarray | DataFrame, y: ndarray | list | Series | None = None, use_dimensionality_reduction: bool = True, use_dimensionality_reduction_method: str = 'spherical_pca') Figure#
The function sphere3d creates a 3D scatter plot with a sphere as the surface and data points plotted on it.
Parameters#
- xnumpy.ndarray, pandas.DataFrame
The parameter x represents the input data for the scatter plot. It should be a 2D array-like object with shape (n_samples, 3), where each row represents the coordinates of a point in 3D space.
- ynumpy.ndarray, list, pandas.series, optional
The parameter y is an optional input that determines the color and shape of each data point in the plot. If y is not provided, the scatter plot will have the default marker symbol and color.
- use_dimensionality_reductionbool, optional
If True, dimensionality reduction is applied to the input data x to project it into 3D space. Defaults to True.
- use_dimensionality_reduction_methodstr, optional
The method used for dimensionality reduction. Currently supports “spherical_pca” or “pca”. Defaults to “spherical_pca”.
Returns#
- go.Figure
Returns a Plotly Figure object containing a 3D plot of a sphere with data points plotted on it.
Examples#
import numpy as np from QuadratiK.tools import sphere3d np.random.seed(42) X = np.random.randn(100,3) sphere3d(X)