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)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| z | Yes | ||
| data_input | No | ||
| levels | No | ||
| filled | No | ||
| style | No | ||
| output | No |