Skip to main content
Glama

plot_contour

Generate contour plots to visualize 3D data in 2D space, showing variable relationships across x-y coordinates for scientific analysis and publication-quality figures.

Instructions

Create a contour plot for 3D data visualization in 2D.

This tool generates contour lines (or filled contours) showing levels of a third variable (z) across x-y coordinates.

Args: x: X coordinates. Column name or list of values. y: Y coordinates. Column name or list of values. z: Z values (2D array). Column name or 2D list. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} levels: Number of contour levels (default: 10) filled: If True, create filled contours (contourf), else lines only style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "colormap": "viridis"} output: Optional. {"format": "png/pdf/svg", "width": 15, "height": 10, "dpi": 300}

Returns: PIL Image object or bytes containing the plot

Examples: Filled contour plot: >>> x = [1, 2, 3, 4, 5] >>> y = [1, 2, 3, 4, 5] >>> z = [[i+j for j in range(5)] for i in range(5)] >>> plot_contour(x=x, y=y, z=z, levels=15, filled=True)

Line contours only: >>> plot_contour( ... x="longitude", ... y="latitude", ... z="temperature", ... data_input={"file_path": "climate_data.csv"}, ... filled=False, ... levels=20 ... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
zYes
data_inputNo
levelsNo
filledNo
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