plot_histogram
Generate histograms to visualize data distribution and frequency patterns for analysis in machine learning research.
Instructions
Create a histogram for data distribution analysis.
This tool generates a histogram showing the frequency distribution of numerical data. Useful for understanding data spread and patterns.
Args: data: Data column name (string) if using data file, or list of values. data_input: Optional. {"file_path": "path/to/file.csv"} or {"data": {...}} bins: Number of histogram bins (default: 30) density: If True, normalize to show probability density 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: Basic histogram: >>> plot_histogram(data=[1.2, 2.3, 2.5, 3.1, 3.4, 4.2, 4.5], bins=10)
Histogram from CSV with density:
>>> plot_histogram(
... data="measurement",
... data_input={"file_path": "measurements.csv"},
... bins=50,
... density=True,
... style={"title": "Measurement Distribution"}
... )Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| data_input | No | ||
| bins | No | ||
| density | No | ||
| style | No | ||
| output | No |