# scope_profiler.plotting_scripts.histogram

*module*

Per-region duration-distribution histograms.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/histogram.py#L1-L1)

## scope_profiler.plotting_scripts.histogram.plot_duration_histogram

*function*

```python
def plot_duration_histogram(profiling_data: ProfilingResults | Sequence[ProfilingResults], ranks: list[int] | int | None = None, include: list[str] | str | None = None, exclude: list[str] | str | None = None, bins: int = 30, filepath: str | None = None, show: bool = False, verbose: bool = True, cmap: str = DEFAULT_CMAP, log_scale: bool = False, data_filepath: str | Path | None = None, data_format: str = 'csv', backend: str = 'matplotlib') -> None
```

Plot each region's call-duration distribution as a frequency line.

One panel per file, one line per region, giving the count of calls
falling in each duration bin - so a region whose calls are mostly fast
with an occasional slow outlier shows up as a peak with a long tail,
something the mean/min/max in :func:`plot_durations` cannot distinguish
from a uniformly slower region.

Parameters
----------
bins : int
    Number of histogram bins spanning each file's observed duration
    range (default: 30). All regions in a panel share the same bin edges,
    so the curves are directly comparable.
backend : str
    Backend to use for rendering: "matplotlib" (default) or "plotly".

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/histogram.py#L26-L202)
