A helper for ploting scatter plots and trajectory plots with plotly
Project description
plotly3d
A helper for ploting scatter plots and trajectory plots with plotly.
Krishnaswamy Lab, Yale University
Install
The package can be directly installed via pip:
pip install plotly3d
APIs
Scatter Plots
def scatter(points, colors=None, **kwargs):
"""
Plots 3D scatter plot with optional rescaling, coloring, and customization.
Parameters:
- points: Array of points to plot.
- colors: Optional array of colors for each point.
- scaler: Optional scaler object to rescale points. If None and rescaling is enabled, MinMaxScaler is used.
- **kwargs: Additional optional arguments:
- s (float): Size of the markers.
- alpha (float): Opacity of the markers.
- force_continuous (bool): Force treating colors as continuous even if they seem categorical.
- title (str): Title of the plot.
- filename (str): If provided, saves the plot to this file.
- rescale (bool): If True, rescales points using the provided or default scaler.
- fig (go.Figure): Plotly figure object to which the scatter plot will be added. If None, a new figure is created.
- xtitle (str), ytitle (str), ztitle (str): Titles for the X, Y, and Z axes.
Returns:
- Plotly figure containing the scatter points plotted in 3D space.
"""
Trajectory Plots
def trajectories(trajs, colors=None, **kwargs):
"""
Plots trajectories in 3D space using Plotly, with unique colors for each category and a single legend entry per category.
Parameters:
- trajs: numpy array of shape (a, b, c), where
a: time bins, b: trajectory index, c: space dimension (c=3 for 3D).
Returns:
- Plotly figure containing the trajectories plotted in 3D space.
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plotly3d-0.4.12.tar.gz
(5.0 kB
view details)
Built Distribution
File details
Details for the file plotly3d-0.4.12.tar.gz
.
File metadata
- Download URL: plotly3d-0.4.12.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79cc3cfad63c3d2e34597aa7f4983c49400f17be9d7215913eeb0d49eeccfd35 |
|
MD5 | 4420b0ca5c78e37d4b9efc91146b8609 |
|
BLAKE2b-256 | 031e54dfc16a680149d5496e1a21f2464bae3468df0072718aa2dea062d711e3 |
File details
Details for the file plotly3d-0.4.12-py3-none-any.whl
.
File metadata
- Download URL: plotly3d-0.4.12-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66adbca21118342b480cc9107e700dfc55b9092a23fcfea27209efa1b12dc809 |
|
MD5 | e29f268436b68917cb50bd29eb43e5c0 |
|
BLAKE2b-256 | 07a22f94489533a2fed37fb22ff52b615fbab9ef1c35152c42d4b2a09292f76b |