scatter_3D#

mufasa.visualization.scatter_3D.scatter_3D(x, y, z, labels=None, nx=None, ny=None, z_scale=0.8, shadow=True, fig=None, savename=None, scene=None, xlab=None, ylab=None, zlab=None, showfig=True, kw_line=None, cmap='Spectral_r', auto_open_html=True, vmin=None, vmax=None, opacity_ranges=1, **kwargs)[source]#

Plot a 3D scatter plot with optional opacity scaling for point ranges.

Parameters:
  • x (array-like) – X coordinates of the data points.

  • y (array-like) – Y coordinates of the data points.

  • z (array-like) – Z coordinates of the data points.

  • labels (array-like, optional) – Label values for color scaling. If ‘peakT’ (default), opacity is split into ranges; otherwise, a single trace with full opacity is used.

  • nx (int, optional) – Number of pixels in x to set the aspect ratio. Default is None.

  • ny (int, optional) – Number of pixels in y to set the aspect ratio. Default is None.

  • z_scale (float, optional) – Aspect ratio for z-axis relative to x and y axes. Default is 0.8.

  • shadow (bool or float, optional) – Adds a shadow projection on the z-plane. Default is True.

  • fig (plotly.graph_objs.Figure, optional) – Figure to plot on. If None, creates a new figure.

  • savename (str, optional) – Path to save the plot as an HTML file. Default is None.

  • scene (dict, optional) – Scene configuration for the 3D plot. Default is None.

  • xlab (str, optional) – X-axis label. Default is None.

  • ylab (str, optional) – Y-axis label. Default is None.

  • zlab (str, optional) – Z-axis label. Default is None.

  • showfig (bool, optional) – Whether to display the figure after plotting. Default is True.

  • kw_line (dict, optional) – Dictionary of line properties for connecting points, if desired. Default is None.

  • cmap (str, optional) – Colormap for data points. Default is ‘Spectral_r’.

  • auto_open_html (bool, optional) – If True, auto-opens saved HTML. Default is True.

  • vmin (float, optional) – Minimum value for color scaling. Default is None.

  • vmax (float, optional) – Maximum value for color scaling. Default is None.

  • opacity_ranges (int, optional) – Number of opacity ranges (1 to 5). For ‘peakT’ labels, splits opacity into equal intervals over 1-99 percentile. Default is 1.

  • kwargs (dict) – Additional keyword arguments for plotting.

Returns:

fig – Generated 3D scatter plot figure.

Return type:

plotly.graph_objs.Figure