Skip to content

plot_spectrum_plotly

Render ctx.spectrum as a Plotly line figure.

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

Parameters

Parameter Default Required Description
title '' - Figure title; empty uses the spectrum's object name.
show_uncertainty True - Draw the uncertainty band when the spectrum has one.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("plot_spectrum_plotly", ctx, {
    "title": "",
    "show_uncertainty": True
})
spectro run plot_spectrum_plotly --input spectrum.fits \
  --param title= \
  --param show_uncertainty=true
{
  "tool": "plot_spectrum_plotly",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "title": "",
      "show_uncertainty": true
    }
  }
}

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

References

  • Plotly — open-source graphing library, https://plotly.com/python/