Plot data
plotDraw charts from inline data and get back a PNG image plus a text summary. Build line, bar, scatter, 3D or molecule panels in a grid and optionally save as PNG, SVG, PDF or HTML.
Instructions
Draw one or more charts from data passed inline in the call and return them as a PNG image plus a short text description of what was drawn.
When to use: you already have the numbers (from the conversation, a computation or another tool). To chart a CSV/TSV/JSON file on disk use plot_file instead; for a 3D protein or DNA structure on its own, molecule is simpler (a molecule panel here is only needed to combine it with other charts).
How: panels is a list of charts laid out in a grid. Each panel has a type (line, scatter, bar, hist, box, violin, heatmap, pie, sankey, candlestick, roc, surface, scatter3d, … 44 in all) plus that type's data fields, for example {"type": "line", "x": [1, 2, 3], "y": [2, 4, 3]}. Call chart_types first if unsure of a type's fields. Options every panel takes: title, x_label, y_label, z_label, x_limits [min, max], y_limits, x_log, y_log, legend, camera [azimuth, elevation] and rotate {x, y, z} in degrees (3D), drawings [{type: trend|ray|fib, from [x, y], to [x, y]} or {type: level, y}].
Behavior: draws in memory and writes nothing unless output is given. Molecule panels with a pdb_id download the structure from files.rcsb.org; nothing else uses the network. Width and height are clamped to 100-6000 px. An invalid spec (unknown type, missing or mismatched data fields) returns an error result whose text names the problem, and nothing is drawn or saved.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"panels": "<panels>"
},
"name": "plot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cols | No | Columns of the panel grid (default: chosen from the number of panels). | |
| rows | No | Rows of the panel grid (default: chosen from the number of panels). | |
| image | No | Return the image (default true; false returns only the text summary). | |
| theme | No | Color theme (default light). high_contrast uses dark colors with at least 4.5:1 contrast and larger text. | |
| title | No | Figure title. | |
| width | No | Width in pixels (default 900). | |
| height | No | Height in pixels (default 600). | |
| output | No | Also save the chart to this file path; the format follows the extension (.png, .svg, .pdf, or .html for an interactive page). An existing file at that path is overwritten. Omit to write nothing. | |
| panels | Yes | Charts, one per panel, laid out in a grid (rows/cols automatic unless given). Each item needs `type` (or `mark` for the grammar of graphics) and that type's data fields. |