plot_line
Generate line plots from CSV, JSON, or direct data inputs to visualize trends and relationships in research data.
Instructions
Create a line plot from data.
This tool generates a line plot using UltraPlot/Matplotlib. You can provide data either as a file path (CSV/JSON) or directly as lists.
Args: x: X-axis data. Column name (string) if using data file, or list of values. y: Y-axis data. Column name (string) if using data file, or list of values. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "colormap": "...", "grid": True} output: Optional. {"format": "png/pdf/svg", "width": 15, "height": 10, "dpi": 300}
Returns: PIL Image object or bytes containing the plot
Examples: Basic line plot with direct data: >>> plot_line(x=[1, 2, 3], y=[1, 4, 9])
Line plot from CSV file:
>>> plot_line(
... x="time",
... y="temperature",
... data_input={"file_path": "experiment.csv"},
... style={"title": "Temperature Over Time", "xlabel": "Time (s)"}
... )
High-resolution PDF output:
>>> plot_line(
... x=[1, 2, 3],
... y=[1, 4, 9],
... output={"format": "pdf", "width": 20, "height": 15}
... )Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| data_input | No | ||
| style | No | ||
| output | No |