Plot Signal
POST /api/plot
Adds a signal to the first plot of the active tab. Creates a new tab and plot automatically if none exists.
Request
POST /api/plot HTTP/1.1Host: localhost:5678Content-Type: application/jsonBody Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
signal_id | string | Yes | Signal ID from POST /api/signals/send or /api/signals/upload |
{ "signal_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"}Response
Status Code: 200 OK
{ "status": "ok", "result": { "plotted": true, "item_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "signal_name": "Sine 5Hz", "plot_name": "Plot 1" }}Errors
| Status | Meaning |
|---|---|
400 | signal_id field missing |
404 | Signal not found |
Example
# Send a signal, capture the signal_idSIGNAL_ID=$(curl -s -X POST http://localhost:5678/api/signals/send \ -H "Content-Type: application/json" \ -d '{"name":"Sine 5Hz","y":[0,1,0,-1,0],"target_source_id":"<source_id>"}' \ | jq -r '.result.signal_id')
# Plot itcurl -s -X POST http://localhost:5678/api/plot \ -H "Content-Type: application/json" \ -d "{\"signal_id\":\"$SIGNAL_ID\"}"Tip
The Python client’s scry.plot() sends the signal and calls this endpoint automatically. See the Python client on GitHub.