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"} ... )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| data_input | No | ||
| orientation | No | vertical | |
| style | No | ||
| output | No |