Skip to main content
Glama

plot_bar

Create bar plots to compare categorical data values, generating publication-quality visualizations for research analysis.

Instructions

Create a bar plot for categorical data comparison.

This tool generates vertical or horizontal bar plots, ideal for comparing values across different categories.

Args: x: Category labels. Column name (string) if using data file, or list of strings. y: Values for each category. Column name or list of numbers. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} orientation: "vertical" or "horizontal" bars (default: "vertical") style: Optional. {"title": "...", "xlabel": "...", "ylabel": "...", "grid": True} output: Optional. {"format": "png/pdf/svg", "width": 15, "height": 10, "dpi": 300}

Returns: PIL Image object or bytes containing the plot

Examples: Vertical bar plot: >>> plot_bar( ... x=["A", "B", "C"], ... y=[10, 25, 15], ... style={"title": "Category Comparison"} ... )

Horizontal bar plot from file: >>> plot_bar( ... x="product", ... y="sales", ... data_input={"file_path": "sales.csv"}, ... orientation="horizontal" ... )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
data_inputNo
orientationNovertical
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