Plot Xy
plot_xyCreate line, scatter, step, or stem charts from CSV or inline JSON data and export deterministic SVG/PNG files for engineering analysis.
Instructions
Draw a line, scatter, step or stem chart of up to 20 series as a deterministic SVG (plot.svg; inline in data.svg_inline when <= 150 kB) and, by default, plot.png 1600 px wide (data.png_path; needs the png extra). The PNG also comes back as an image in the reply (inline_image): hand over the PNG, not the SVG path. Also plot_data.json. Data: a CSV with a header row (e.g. another tool's CSV artifact) or inline JSON series. Log axes, fixed ranges, a right axis, reference lines, a band, one marked point, fill to zero, themes, unwrap_phase for a Bode phase. Dense series are min/max decimated.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "plot_xy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| band | No | One shaded horizontal band 'lo,hi,label' in left-axis units, e.g. '-100,100,allowable'; blank = none. | |
| fill | No | none, or zero = shade between each line and y = 0, positive and negative in two tints (shear/moment diagrams). | none |
| grid | No | true draws grid lines at the major ticks (and log minor ticks); false draws none. | |
| kind | No | line, scatter, step (value holds until the next x) or stem; or one per series in order, e.g. 'line,scatter'. | line |
| theme | No | auto (follows the viewer's light/dark setting), light, dark, or print (black and grey with dash patterns). | auto |
| title | No | Chart title, plain text of at most 120 characters, e.g. 'Beam shear force'; blank = none. | |
| width | No | SVG width in px, 200..2400, e.g. 800. | |
| format | No | Picture file: both (default: plot.svg + plot.png 1600 px wide; PNG needs the png extra), svg (no PNG) or png (no SVG). | both |
| height | No | SVG height in px, 200..2400, e.g. 500. | |
| hlines | No | Horizontal reference lines 'value,label;...' in left-axis units, e.g. '250,yield;-250,'; at most 10. | |
| legend | No | auto (2+ series, emptiest corner), off, top_right, top_left, bottom_right, bottom_left or right (outside). | auto |
| marker | No | Optional: ring one point 'x,y,label' in x and left-axis units, e.g. '1200,45.5,duty point' (operating point); blank = none. | |
| series | No | Inline JSON instead of a file: [{"name":"a","x":[0,1],"y":[2,3]}]; <=20 series, <=200000 points each; x optional. | |
| vlines | No | Vertical reference lines 'value,label;...' in x units, e.g. '1000,cutoff'; at most 10. | |
| markers | No | true puts a marker on every drawn point of line/step series (scatter and stem always have markers). | |
| x_label | No | x axis title including its unit, plain text <= 120 characters, e.g. 'Frequency (Hz)'. | |
| x_range | No | Fixed x axis 'min,max': plain numbers in the axis unit, no unit text, e.g. '0,4000' (not '0,10 s'); blank = automatic. | |
| x_scale | No | linear or log; a log x axis refuses zero or negative x values (nothing is dropped silently). | linear |
| y_label | No | Left axis title including its unit, e.g. 'Magnitude (dB)'; plain text <= 120 characters. | |
| y_range | No | Fixed left-axis 'min,max': plain numbers in the axis unit, no unit text, e.g. '-80,5'; blank = automatic; outside points are clipped. | |
| y_scale | No | linear or log for the left axis; log refuses zero or negative y values. | linear |
| x_column | No | CSV header name of the x column, e.g. 'frequency_hz'; blank = the first column. CSV mode only. | |
| y2_label | No | Right axis title including its unit, e.g. 'Phase (deg)'; used together with y2_columns. | |
| data_file | No | CSV/TXT path with a header row, e.g. a tool's ws/<job>/filter_response.csv artifact. Give this or 'series'. | |
| y_columns | No | Comma-separated CSV columns for the left axis, e.g. 'magnitude_db'; blank = every other numeric column. | |
| y2_columns | No | Columns (CSV) or series names (inline) drawn against a right-hand axis, e.g. 'phase_deg'; blank = none. | |
| inline_image | No | true (default): the PNG also comes back as an image block in the reply when it is <= 600 kB; false: path only. | |
| unwrap_phase | No | true unwraps every series whose name contains 'phase' (degrees; 'rad' in the name: radians): no +-180 jumps in a Bode phase. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | Non-quantity payload (reports, listings) | |
| error | No | ||
| value | No | Primary quantity result | |
| values | No | All named quantity results (includes the primary) | |
| warnings | No | ||
| artifacts | No | ||
| provenance | Yes | What produced the result and from which inputs. | |
| review_status | No | unreviewed |