Skip to main content
Glama

plot_heatmap

Generate publication-quality heatmaps to visualize matrix data like correlation matrices, confusion matrices, or any 2D datasets with customizable annotations and styling.

Instructions

Create a heatmap for visualizing matrix data.

This tool generates a heatmap with optional annotations, ideal for correlation matrices, confusion matrices, or any 2D data.

Args: data: For direct input, 2D list (matrix). For file input, column name. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} x_labels: Optional labels for x-axis (columns) y_labels: Optional labels for y-axis (rows) annotate: If True, show values in each cell 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: Correlation matrix: >>> plot_heatmap( ... data=[[1.0, 0.8, 0.3], [0.8, 1.0, 0.5], [0.3, 0.5, 1.0]], ... x_labels=["A", "B", "C"], ... y_labels=["A", "B", "C"], ... annotate=True, ... style={"title": "Correlation Matrix", "colormap": "RdBu"} ... )

From file: >>> plot_heatmap( ... data="matrix", ... data_input={"file_path": "data_matrix.csv"}, ... style={"colormap": "plasma"} ... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
data_inputNo
x_labelsNo
y_labelsNo
annotateNo
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