plot_export_image
Render and export COMSOL plot groups as image files with chosen format, dimensions, DPI, background, and antialiasing, validating the written output.
Instructions
Render plot group(s) and export image file(s), validated with Pillow.
Exports COMSOL's Image feature with the exact clientapi properties:
plotgroup, imagetype, <type>filename (pngfilename /
jpegfilename / bmpfilename / epsfilename / gltffilename),
width/height (px when unit="px"), unit, resolution
(dpi), optional size preset, background, antialias.
Args:
plotgroup: single plot group tag to export (e.g. "pg1").
path: output file path. For a single plot group a .png/.jpg
path is used as-is; when omitted a unique path under
<artifact_root>/<model>/<timestamp>_plots/ is generated.
For multiple plot groups this is treated as a directory.
width: image width in px (default 1200).
height: image height in px (default 900).
unit: px (default) | mm | in.
dpi: optional COMSOL resolution property (e.g. 150).
imagetype: png (default) | jpeg | bmp | eps | gltf.
eps only works for 1D plot groups; gltf is 3D-only and may not be
produced in headless COMSOL 6.4.
size: optional COMSOL size preset manualprint/manualweb/
current/presentation; leave empty to honour width/height.
background: current | color | transparent.
antialias: on | off.
plotgroups: export several plot groups in one call (list of tags);
alternatively omit both plotgroup and plotgroups to
export every plot group in the model.
model: model name/tag (None = current model).
Returns:
For one group: {"path","size","width","height","format","valid", "plotgroup", ...} measured on the written file. For several:
{"images": [ ... ], "count", "directory"}.
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_export_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | ||
| path | No | ||
| size | No | ||
| unit | No | px | |
| model | No | ||
| width | No | ||
| height | No | ||
| antialias | No | ||
| imagetype | No | png | |
| plotgroup | No | ||
| background | No | ||
| plotgroups | No |