> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Plotting

> systematica.utils.plotting

## `plot_allocation`

```python theme={null}
plot_allocation(
    data: vectorbtpro.data.base.Data,
    signals: ~Signals,
    fig: vectorbtpro.utils.figure.FigureWidget = None,
)
```

Plot asset allocation based on trading signals.

**Parameters**:

| Name      | Type               | Default | Description                                    |
| --------- | ------------------ | ------- | ---------------------------------------------- |
| `data`    | `vbt.Data`         | `--`    | Data object containing asset prices.           |
| `signals` | `SignalsT`         | `--`    | Object containing trading signals.             |
| `fig`     | `vbt.FigureWidget` | `None`  | Existing figure to update. Defaults to `None`. |

**Returns**:

| Type               | Description                            |
| ------------------ | -------------------------------------- |
| `vbt.FigureWidget` | Figure containing the allocation plot. |

## `plot_signal_crossover`

```python theme={null}
plot_signal_crossover(
    model_output: pandas.core.series.Series,
    upper_crossed: pandas.core.series.Series,
    lower_crossed: pandas.core.series.Series,
    upper: float,
    lower: float,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot signal crossover points with upper and lower bounds.

**Parameters**:

| Name            | Type        | Default | Description                                  |
| --------------- | ----------- | ------- | -------------------------------------------- |
| `model_output`  | `pd.Series` | `--`    | Model output series.                         |
| `upper_crossed` | `pd.Series` | `--`    | Series indicating upper boundary crossovers. |
| `lower_crossed` | `pd.Series` | `--`    | Series indicating lower boundary crossovers. |
| `upper`         | `float`     | `--`    | Upper threshold value.                       |
| `lower`         | `float`     | `--`    | Lower threshold value.                       |

**Returns**:

| Type               | Description                           |
| ------------------ | ------------------------------------- |
| `vbt.FigureWidget` | Figure containing the crossover plot. |

## `plot_signals`

```python theme={null}
plot_signals(
    data: vectorbtpro.data.base.Data,
    symbol: str,
    signals: ~Signals,
    fig: vectorbtpro.utils.figure.FigureWidget = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trading signals on a price chart.

This function overlays trading signals (long/short entries and exits) on a price chart
for a given asset symbol. It uses the provided data and signals to generate the plot.

**Parameters**:

| Name          | Type               | Default | Description                                                                           |
| ------------- | ------------------ | ------- | ------------------------------------------------------------------------------------- |
| `data`        | `vbt.Data`         | `--`    | A data object containing asset prices and other relevant information.                 |
| `symbol`      | `str`              | `--`    | The asset symbol to plot.                                                             |
| `signals`     | `SignalsT`         | `--`    | An object containing trading signals (long/short entries and exits).                  |
| `fig`         | `vbt.FigureWidget` | `None`  | An existing figure to update. If `None`, a new figure is created. Defaults to `None`. |
| `plot_kwargs` | `tp.Kwargs`        | `--`    | Additional keyword arguments for customizing the plot.                                |

**Returns**:

| Type               | Description                                          |
| ------------------ | ---------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the signals plot. |

**Examples**:

```python theme={null}
>>> fig = plot_signals("AAPL", data, signals)
>>> fig.show()
```

## `plot_signal_vlines`

```python theme={null}
plot_signal_vlines(
    df: pandas.core.frame.DataFrame,
    symbol: str,
    signals: ~Signals,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot long and short entry signals as vertical lines.

**Parameters**:

| Name          | Type           | Default | Description                                |
| ------------- | -------------- | ------- | ------------------------------------------ |
| `df`          | `pd.DataFrame` | `--`    | Dataframe containing price data.           |
| `symbol`      | `str`          | `--`    | Symbol for which to plot signals.          |
| `signals`     | `Signals`      | `--`    | Signal object containing entry points.     |
| `plot_kwargs` | `tp.Kwargs`    | `--`    | Additional keyword arguments for plotting. |

**Returns**:

| Type               | Description                                            |
| ------------------ | ------------------------------------------------------ |
| `vbt.FigureWidget` | A figure with entry signals plotted as vertical lines. |

## `plot_dashboard`

```python theme={null}
plot_dashboard(
    data: vectorbtpro.data.base.Data,
    s1: str,
    s2: str,
    pf: vectorbtpro.portfolio.base.Portfolio,
    model_output: numpy.ndarray,
    showlegend: bool = False,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Generate a dashboard visualization for a pair of assets.

**Parameters**:

| Name            | Type            | Default | Description                                              |
| --------------- | --------------- | ------- | -------------------------------------------------------- |
| `data`          | `vbt.Data`      | `--`    | Market data.                                             |
| `s1`            | `str`           | `--`    | First asset symbol.                                      |
| `s2`            | `str`           | `--`    | Second asset symbol.                                     |
| `pf`            | `vbt.Portfolio` | `--`    | Portfolio object.                                        |
| `model_output`  | `tp.Array`      | `--`    | Model output data.                                       |
| `showlegend`    | `bool`          | `False` | Show legend. Defaults to `False`.                        |
| `layout_kwargs` | `tp.Kwargs`     | `--`    | Additional keyword arguments for customizing the layout. |

**Returns**:

| Type               | Description                                                               |
| ------------------ | ------------------------------------------------------------------------- |
| `vbt.FigureWidget` | A dashboard figure displaying asset data, portfolio returns, and signals. |

## `plot_pie_chart`

```python theme={null}
plot_pie_chart(
    *args,
    **kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot a pie chart.

This function creates a pie chart using the `Pie` class from `systematica.utils.custom_plots`.

**Parameters**:

| Name     | Type        | Default | Description                                     |
| -------- | ----------- | ------- | ----------------------------------------------- |
| `args`   | `tp.Args`   | `--`    | Positional arguments passed to the `Pie` class. |
| `kwargs` | `tp.Kwargs` | `--`    | Keyword arguments passed to the `Pie` class.    |

**Returns**:

| Type               | Description                                       |
| ------------------ | ------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the pie chart. |

## `plot_allocations`

```python theme={null}
plot_allocations(
    pfo: vectorbtpro.portfolio.pfopt.base.PortfolioOptimizer,
    market_returns: pandas.core.frame.DataFrame,
    categories: pandas.core.frame.DataFrame = None,
    group_by_category: bool = False,
    column: Hashable = None,
    dropna: str = 'head',
    line_shape: str = 'hv',
    plot_rb_dates: bool = None,
    trace_kwargs: Dict[str, Any] | Sequence[Dict[str, Any] | None] | None = None,
    add_shape_kwargs: Dict[str, Any] | None = None,
    add_trace_kwargs: Dict[str, Any] | None = None,
    fig: plotly.basedatatypes.BaseFigure = None,
    **layout_kwargs,
) ‑> plotly.basedatatypes.BaseFigure
```

Plot portfolio allocations over time.

This function visualizes portfolio allocations as an area plot. It supports grouping
by categories and marking rebalancing dates.

**Parameters**:

| Name                | Type                     | Default  | Description                                                                      |
| ------------------- | ------------------------ | -------- | -------------------------------------------------------------------------------- |
| `pfo`               | `vbt.PortfolioOptimizer` | `--`     | Portfolio optimizer object containing allocation data.                           |
| `market_returns`    | `pd.DataFrame`           | `--`     | DataFrame containing market returns.                                             |
| `categories`        | `pd.DataFrame`           | `None`   | DataFrame containing category information for assets. Defaults to `None`.        |
| `group_by_category` | `bool`                   | `False`  | Whether to group allocations by category. Defaults to `False`.                   |
| `column`            | `tp.Label`               | `None`   | Column to select from the portfolio optimizer. Defaults to `None`.               |
| `dropna`            | `str`                    | `"head"` | How to handle NaN values in allocations. Defaults to `head`.                     |
| `line_shape`        | `str`                    | `"hv"`   | Shape of the lines in the area plot. Defaults to `hv`.                           |
| `plot_rb_dates`     | `bool`                   | `None`   | Whether to plot rebalancing dates. Defaults to `None`.                           |
| `trace_kwargs`      | `tp.KwargsLikeSequence`  | `None`   | Additional keyword arguments for traces. Defaults to `None`.                     |
| `add_shape_kwargs`  | `tp.KwargsLike`          | `None`   | Additional keyword arguments for shapes. Defaults to `None`.                     |
| `add_trace_kwargs`  | `tp.KwargsLike`          | `None`   | Additional keyword arguments for adding traces. Defaults to `None`.              |
| `fig`               | `tp.BaseFigure`          | `None`   | Existing figure to update. If None, a new figure is created. Defaults to `None`. |
| `layout_kwargs`     | `tp.Kwargs`              | `--`     | Additional layout arguments for the figure.                                      |

**Returns**:

| Type            | Description                                          |
| --------------- | ---------------------------------------------------- |
| `tp.BaseFigure` | A Plotly BaseFigure containing the allocations plot. |

## `plot_performance_matrix`

```python theme={null}
plot_performance_matrix(
    pf: Any,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Create a performance matrix heatmap.

This function generates a heatmap of performance metrics for the given portfolio
by resampling returns data to a monthly frequency. The matrix displays monthly returns
by year, with an additional column for the total annual return.

**Parameters**:

| Name          | Type        | Default | Description                                                  |
| ------------- | ----------- | ------- | ------------------------------------------------------------ |
| `pf`          | `tp.Any`    | `--`    | The portfolio object containing return data.                 |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional keyword arguments passed to the heatmap function. |

**Returns**:

| Type               | Description                                                        |
| ------------------ | ------------------------------------------------------------------ |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the performance matrix heatmap. |

**Examples**:

```python theme={null}
>>> pf = ...  # Initialize your portfolio object
>>> fig = plot_performance_matrix(pf)
>>> fig.show()
```

## `plot_performance_reset`

```python theme={null}
plot_performance_reset(
    data: pandas.core.series.Series | pandas.core.frame.DataFrame,
    by: str = 'M',
    fig: vectorbtpro.utils.figure.FigureWidget = None,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot performance reset by month or year.

This function calculates and plots the percentage change in performance
reset at the start of each month or year.

**Parameters**:

| Name   | Type               | Default | Description                                                                      |
| ------ | ------------------ | ------- | -------------------------------------------------------------------------------- |
| `data` | `tp.SeriesFrame`   | `--`    | Time series data of performance values.                                          |
| `by`   | `str`              | `M`     | Reset frequency: `M` for monthly or `Y` for yearly. Defaults to `M`.             |
| `fig`  | `vbt.FigureWidget` | `None`  | Existing figure to update. If None, a new figure is created. Defaults to `None`. |

**Returns**:

| Type               | Description                                                    |
| ------------------ | -------------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the performance reset plot. |

## `plot_performance_rebase`

```python theme={null}
plot_performance_rebase(
    df: pandas.core.series.Series | pandas.core.frame.DataFrame,
    fig: vectorbtpro.utils.figure.FigureWidget = None,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot rebased performance.

This function rebases the performance data to a starting value of 1 and plots it.

**Parameters**:

| Name  | Type               | Default | Description                                                                      |
| ----- | ------------------ | ------- | -------------------------------------------------------------------------------- |
| `df`  | `tp.SeriesFrame`   | `--`    | Time series data of performance values.                                          |
| `fig` | `vbt.FigureWidget` | `None`  | Existing figure to update. If None, a new figure is created. Defaults to `None`. |

**Returns**:

| Type               | Description                                                      |
| ------------------ | ---------------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the rebased performance plot. |

## `plot_cash`

```python theme={null}
plot_cash(
    pf: Any,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot cash-related metrics for a portfolio.

This function creates subplots for cash, cash flow, gross exposure, and net exposure.

**Parameters**:

| Name          | Type        | Default | Description                                            |
| ------------- | ----------- | ------- | ------------------------------------------------------ |
| `pf`          | `tp.Any`    | `--`    | Portfolio object containing cash-related data.         |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional keyword arguments for customizing the plot. |

**Returns**:

| Type               | Description                                                |
| ------------------ | ---------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the cash-related plots. |

## `plot_excursions`

```python theme={null}
plot_excursions(
    pf: Any,
    expanding: bool = True,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trade excursions for a portfolio.

This function visualizes Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE)
for each trade in the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                                            |
| ------------- | ----------- | ------- | ------------------------------------------------------ |
| `pf`          | `tp.Any`    | `--`    | Portfolio object containing trade data.                |
| `expanding`   | `bool`      | `True`  | Whether to plot expanding MAE/MFE. Defaults to `True`. |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional keyword arguments for customizing the plot. |

**Returns**:

| Type               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the excursion plots. |

## `plot_all_trades`

```python theme={null}
plot_all_trades(
    pf: Any,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Create a plot of all trades in the portfolio.

The function generates subplots for all trades within the specified portfolio.

**Parameters**:

| Name            | Type        | Default | Description                                            |
| --------------- | ----------- | ------- | ------------------------------------------------------ |
| `port`          | `tp.Any`    | `--`    | The portfolio object containing trade data.            |
| `layout_kwargs` | `tp.Kwargs` | `--`    | Additional keyword arguments for layout configuration. |

**Returns**:

| Type               | Description                                          |
| ------------------ | ---------------------------------------------------- |
| `vbt.FigureWidget` | A figure widget containing the plots for all trades. |

**Examples**:

```python theme={null}
>>> port = ...  # Initialize your portfolio object
>>> fig = plot_all_trades(port)
>>> fig.show()
```

## `plot_drawdown`

```python theme={null}
plot_drawdown(
    pf: Any,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Create a drawdown plot for the portfolio.

This function visualizes the drawdowns and underwater metrics of the portfolio.

**Parameters**:

| Name          | Type        | Default | Description                                            |
| ------------- | ----------- | ------- | ------------------------------------------------------ |
| `port`        | `tp.Any`    | `--`    | The portfolio object containing drawdown data.         |
| `plot_kwargs` | `tp.Kwargs` | `--`    | Additional keyword arguments for customizing the plot. |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A figure widget containing the drawdown plots. |

**Examples**:

```python theme={null}
>>> pf = ...  # Initialize your portfolio object
>>> fig = plot_drawdown(pf)
>>> fig.show()
```

## `plot_trades`

```python theme={null}
plot_trades(
    pf: Any,
    symbol: str,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trades and asset flow for a specific symbol.

This function creates subplots for trades, asset flow, and asset holdings.

**Parameters**:

| Name     | Type     | Default | Description                                     |
| -------- | -------- | ------- | ----------------------------------------------- |
| `pf`     | `tp.Any` | `--`    | Portfolio object containing trade data.         |
| `symbol` | `str`    | `--`    | Symbol for which to plot trades and asset flow. |

**Returns**:

| Type               | Description                                                         |
| ------------------ | ------------------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trades and asset flow plots. |

## `plot_smas`

```python theme={null}
plot_smas(
    close: pandas.core.frame.DataFrame,
    timeperiods: list = None,
    length: int = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot Simple Moving Averages (SMAs).

This function calculates and plots SMAs for the specified time periods.

**Parameters**:

| Name          | Type             | Default | Description                                                                  |
| ------------- | ---------------- | ------- | ---------------------------------------------------------------------------- |
| `close`       | `pd.DataFrame`   | `--`    | DataFrame containing closing prices.                                         |
| `timeperiods` | `list, optional` | `--`    | List of time periods for SMAs. Defaults to `[20, 50, 100, 200]`.             |
| `length`      | `int, optional`  | `--`    | Number of data points to include in the plot. Defaults to `None` (all data). |
| `plot_kwargs` | `tp.Kwargs`      | `--`    | Additional keyword arguments for customizing the plot.                       |

**Returns**:

| Type               | Description                                       |
| ------------------ | ------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the SMA plots. |

## `plot_bbands`

```python theme={null}
plot_bbands(
    close: pandas.core.frame.DataFrame,
    length: int = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot Bollinger Bands.

This function calculates and plots Bollinger Bands for the given data.

**Parameters**:

| Name          | Type           | Default | Description                                                                  |
| ------------- | -------------- | ------- | ---------------------------------------------------------------------------- |
| `close`       | `pd.DataFrame` | `--`    | DataFrame containing closing prices.                                         |
| `length`      | `int`          | `None`  | Number of data points to include in the plot. Defaults to `None` (all data). |
| `plot_kwargs` | `tp.Kwargs`    | `--`    | Additional keyword arguments for customizing the plot.                       |

**Returns**:

| Type               | Description                                                  |
| ------------------ | ------------------------------------------------------------ |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the Bollinger Bands plot. |

## `plot_slope_range`

```python theme={null}
plot_slope_range(
    close: pandas.core.frame.DataFrame,
    window: int = 50,
    length: int = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot slope ranges for a moving average.

This function identifies and visualizes steep slopes in a moving average.

**Parameters**:

| Name          | Type           | Default | Description                                                                  |
| ------------- | -------------- | ------- | ---------------------------------------------------------------------------- |
| `close`       | `pd.DataFrame` | `--`    | DataFrame containing closing prices.                                         |
| `window`      | `int`          | `50`    | Window size for the moving average. Defaults to `50`.                        |
| `length`      | `int`          | `None`  | Number of data points to include in the plot. Defaults to `None` (all data). |
| `plot_kwargs` | `tp.Kwargs`    | `--`    | Additional keyword arguments for customizing the plot.                       |

**Returns**:

| Type               | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the slope range plot. |

## `plot_pattern`

```python theme={null}
plot_pattern(
    close: pandas.core.frame.DataFrame,
    pattern: Union(annotations=(<class 'vectorbtpro.utils.params.Param'>, <class 'list'>), resolved=True) = None,
    window: int = 50,
    max_window: int = 120,
    min_similarity: float = 0.8,
    length: int = None,
    **plot_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot pattern matches in price data.

This function identifies and visualizes occurrences of a specified pattern in the price data.

**Parameters**:

| Name             | Type           | Default | Description                                                                |
| ---------------- | -------------- | ------- | -------------------------------------------------------------------------- |
| `close`          | `pd.DataFrame` | `--`    | DataFrame containing closing prices.                                       |
| `pattern`        | `list`         | `--`    | or vbt.Param, default None Pattern to search for. Defaults None.           |
| `window`         | `int`          | `50`    | Minimum window size for pattern matching. Defaults to 50.                  |
| `max_window`     | `int`          | `120`   | Maximum window size for pattern matching. Defaults to 120.                 |
| `min_similarity` | `float`        | `0.8`   | Minimum similarity threshold for pattern matching. Defaults to 0.8.        |
| `length`         | `int`          | `None`  | Number of data points to include in the plot. Defaults to None (all data). |
| `plot_kwargs`    | `tp.Kwargs`    | `--`    | Additional keyword arguments for customizing the plot.                     |

**Returns**:

| Type               | Description                                                |
| ------------------ | ---------------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the pattern match plot. |

## `plot_frontier`

```python theme={null}
plot_frontier(
    target_portfolio: pandas.core.frame.DataFrame,
    efficient_frontier: pandas.core.frame.DataFrame = None,
    portfolio_name: str = 'Target Portfolio',
    marker_color: str = 'red',
    marker_size: int = 20,
    make_figure_kwargs: Dict[str, Any] | None = None,
    fig: plotly.basedatatypes.BaseFigure = None,
    showscale: bool = True,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot Frontier.

**Parameters**:

| Name                 | Type             | Default     | Description                                                   |
| -------------------- | ---------------- | ----------- | ------------------------------------------------------------- |
| `target_portfolio`   | `pd.DataFrame`   | `--`        | Target\_portfolio.                                            |
| `efficient_frontier` | `pd.DataFrame`   | `None`      | Efficient frontier. If `None`, the frontier is not displayed. |
| `portfolio_name`     | `str`            | `Target...` | Portfolio name. Defaults to `Target Portfolio`.               |
| `marker_color`       | `str`            | `red`       | Color of the portfolio star shaped marker. Defaults to `red`. |
| `marker_size`        | `int`            | `20`        | Size of the portfolio star shaped marker. Default to `20`.    |
| `make_figure_kwargs` | `tp.KwargsLike`  | `None`      | Additional figure arguments. Defaults to `None`.              |
| `fig`                | `ttp.BaseFigure` | `None`      | Figure. Defaults to None.                                     |
| `showscale`          | `bool`           | `True`      | Show scale. Defaults to `True`.                               |
| `layout_kwargs`      | `tp.Kwargs`      | `--`        | Additional layout arguments for the figure.                   |

**Returns**:

| Type               | Description                                       |
| ------------------ | ------------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing frontier plot. |

## `plot_scatter_matrix`

```python theme={null}
plot_scatter_matrix(
    df: pandas.core.frame.DataFrame,
    metrics: List[str],
    params: List[str],
    n_columns: int = 3,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trial.

**Parameters**:

| Name            | Type           | Default | Description                                     |
| --------------- | -------------- | ------- | ----------------------------------------------- |
| `df`            | `pd.DataFrame` | `--`    | Trial dataframe.                                |
| `metrics`       | `tp.List[str]` | `--`    | Metric columns.                                 |
| `params`        | `str`          | `--`    | Param columns.                                  |
| `n_columns`     | `int`          | `3`     | Number of columns in the grid. Defaults to `3`. |
| `layout_kwargs` | `tp.Kwargs`    | `--`    | Additional layout arguments for the figure.     |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |

## `plot_histogram_matrix`

```python theme={null}
plot_histogram_matrix(
    df: pandas.core.frame.DataFrame,
    metrics: List[str],
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot trial.

**Parameters**:

| Name            | Type           | Default | Description                                 |
| --------------- | -------------- | ------- | ------------------------------------------- |
| `df`            | `pd.DataFrame` | `--`    | Trial dataframe.                            |
| `metrics`       | `tp.List[str]` | `--`    | Metric columns.                             |
| `layout_kwargs` | `tp.Kwargs`    | `--`    | Additional layout arguments for the figure. |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |

## `plot_density_heatmap`

```python theme={null}
plot_density_heatmap(
    df: pandas.core.frame.DataFrame,
    metric: str,
    param: str,
    **kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot density heatmap.

**Parameters**:

| Name     | Type           | Default | Description                                 |
| -------- | -------------- | ------- | ------------------------------------------- |
| `df`     | `pd.DataFrame` | `--`    | Trial dataframe.                            |
| `metric` | `str`          | `--`    | Metric column.                              |
| `param`  | `str`          | `--`    | Param column.                               |
| `kwargs` | `tp.Kwargs`    | `--`    | Additional layout arguments for the figure. |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |

## `plot_density_contour`

```python theme={null}
plot_density_contour(
    df: pandas.core.frame.DataFrame,
    metric: str,
    param: str,
    colorscale: List[str | Tuple[float]],
    **kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot density contour.

**Parameters**:

| Name     | Type           | Default | Description                                 |
| -------- | -------------- | ------- | ------------------------------------------- |
| `df`     | `pd.DataFrame` | `--`    | Trial dataframe.                            |
| `metric` | `str`          | `--`    | Metric column.                              |
| `param`  | `str`          | `--`    | Param column.                               |
| `kwargs` | `tp.Kwargs`    | `--`    | Additional layout arguments for the figure. |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |

## `plot_range_breakout_signals`

```python theme={null}
plot_range_breakout_signals(
    data: vectorbtpro.data.base.Data,
    symbol: str,
    training_window: str = '2h',
    by: str = 'D',
    freq: str = 'hours',
    tol: float = 0.5,
    use_close: bool = True,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot range breakout.

**Parameters**:

| Name              | Type        | Default | Description                                                                                              |
| ----------------- | ----------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `data`            | `vbt.Data`  | `--`    | A data object containing asset prices and other relevant information.                                    |
| `symbol`          | `str`       | `--`    | The asset symbol to plot.                                                                                |
| `training_window` | `str`       | `2h`    | The split size of the training window used in `splitter.from_grouper`. Defaults to `2h`                  |
| `by`              | `str`       | `D`     | Split data temporarily. Defaults to `D` for daily.                                                       |
| `freq`            | `str`       | `hours` | Split data with `by`. Defaults to `hours`.                                                               |
| `tol`             | `float`     | `0.5`   | Range tolerance to trigger a long/short signal such as `trigger = tol * range_values`. Defauts to `0.5`. |
| `use_close`       | `bool`      | `True`  | Use close or open price for signals. Defaults to `True` (close).                                         |
| `layout_kwargs`   | `tp.Kwargs` | `--`    | Additional layout arguments for the figure.                                                              |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |

## `plot_range_breakout_model_output`

```python theme={null}
plot_range_breakout_model_output(
    data: vectorbtpro.data.base.Data,
    symbol: str,
    training_window: str = '2h',
    by: str = 'D',
    freq: str = 'hours',
    tol: float = 0.5,
    use_close: bool = True,
    **layout_kwargs,
) ‑> vectorbtpro.utils.figure.FigureWidget
```

Plot range breakout indicator.

**Parameters**:

| Name              | Type        | Default | Description                                                                                              |
| ----------------- | ----------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `data`            | `vbt.Data`  | `--`    | A data object containing asset prices and other relevant information.                                    |
| `symbol`          | `str`       | `--`    | The asset symbol to plot.                                                                                |
| `training_window` | `str`       | `2h`    | The split size of the training window used in `splitter.from_grouper`. Defaults to `2h`.                 |
| `by`              | `str`       | `D`     | Split data temporarily. Defaults to `D` for daily.                                                       |
| `freq`            | `str`       | `hours` | Split data with `by`. Defaults to `hours`.                                                               |
| `tol`             | `float`     | `0.5`   | Range tolerance to trigger a long/short signal such as `trigger = tol * range_values`. Defauts to `0.5`. |
| `use_close`       | `bool`      | `True`  | Use close or open price for signals. Defaults to `True` (close).                                         |
| `layout_kwargs`   | `tp.Kwargs` | `--`    | Additional layout arguments for the figure.                                                              |

**Returns**:

| Type               | Description                                    |
| ------------------ | ---------------------------------------------- |
| `vbt.FigureWidget` | A Plotly `FigureWidget` containing the trials. |
