Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
data_inputNo
styleNo
outputNo

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nishide-dev/ml-research-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server