Skip to content

plot_3d_surface_plotly

Render every spectrum in ctx.spectra as one row of a 3D surface.

Category Visualisation
Backend plotly - renders figures with plotly (optional extra viz)
Version 1.0.0
Reads ctx.spectra (a list of Spectrum1D)
Writes figures.surface

Parameters

Parameter Default Required Description
title 'stacked spectra — 3D surface' - Figure title.
n_grid 512 - Number of wavelength samples on the common grid.
colormap 'Viridis' - Plotly colour scale name.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("plot_3d_surface_plotly", ctx, {
    "title": "stacked spectra \u2014 3D surface",
    "n_grid": 512,
    "colormap": "Viridis"
})

The CLI loads a single 1-D spectrum with --input; this algorithm needs ctx.spectra (a list of Spectrum1D). Run it from Python or as a step of a pipeline preset.

{
  "tool": "plot_3d_surface_plotly",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "title": "stacked spectra \u2014 3D surface",
      "n_grid": 512,
      "colormap": "Viridis"
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • Plotly — https://plotly.com/python/3d-surface-plots/