---
title: Dynamic Plots
---

> [!WARNING]
> Legacy documentation: This documentation applies to **Legacy Deephaven Enterprise only** and does not apply to Core+.

> [!NOTE]
> For Core+ workers, see Community Core documentation for [dynamic plots](/core/docs/how-to-guides/plotting/api-plotting#dynamic-plots).

Plots configured with a selectable dataset can be paired with Deephaven's Input Filter, Linker feature, or drop-down filters. As the input changes, the paired plot will dynamically update to reflect the filtered dataset.

## `oneClick`

To create a dynamically updating plot - a plot that updates with "one click" in the console -, the data source must be a `SelectableDataSet`. This is easily accomplished with the use of the `oneClick` method:

`.oneClick(source, "ColName1", "ColName2", ...)`

- `source` is the table containing the data.
- Additional arguments represent the name(s) of each column (as a string) to be available for input filtering.

```python
from deephaven import Plot

t = (
    db.t("LearnDeephaven", "StockTrades")
    .where("Date=`2017-08-21`")
    .where("USym in `AAPL`,`GOOG`,`CSCO`,`IBM`,`MSFT`,`INTC`")
)

toc = Plot.oneClick(t, "USym")

RetailPlot = Plot.plot("USym", toc, "Timestamp", "Last").show()
```

```groovy
t = db.t("LearnDeephaven","StockTrades")
    .where("Date=`2017-08-21`")
    .where("USym in `AAPL`,`GOOG`,`CSCO`,`IBM`,`MSFT`,`INTC`")

toc = oneClick(t, "USym")

RetailPlot = plot("USym", toc, "Timestamp", "Last").show()
```

When `retailPlot` opens in the console, you will be prompted to "Add Input Filters" or "Use the Linker Tool" to filter the data in the appropriate column (in this case, "USym") before the plot will draw.

![An overlay that prompts the user to either add an Input Filter or use the Linker tool](../../assets/plotting/add-input-filters.png)

However, including an optional boolean argument set to `false` will plot the entire table without a filter applied.

```python
from deephaven import Plot

t = (
    db.t("LearnDeephaven", "StockTrades")
    .where("Date=`2017-08-21`")
    .where("USym in `AAPL`,`GOOG`,`CSCO`,`IBM`,`MSFT`,`INTC`")
)

toc = Plot.oneClick(t, False, "USym")

RetailPlot2 = Plot.plot("USym", toc, "Timestamp", "Last").show()
```

```groovy
t = db.t("LearnDeephaven","StockTrades")
     .where("Date=`2017-08-21`")
     .where("USym in `AAPL`,`GOOG`,`CSCO`,`IBM`,`MSFT`,`INTC`")

toc = oneClick(t, false, "USym")

RetailPlot2 = plot("USym", toc, "Timestamp", "Last").show()
```

![The dynamic plot, with no filter](../../assets/plotting/dynamic-no-filter.png)

## Input Filters

In order to pair your dynamic plot with an Input Filter, either click the **Add Input Filters** button in the console, or choose the Input Filter option from the **Controls** menu.

The plot will automatically update as you input values in the filter.

![The plot updates automatically as you input values in the filter](../../assets/plotting/input-filter.gif)

> [!NOTE]
> The Input Filter feature filters _every_ open table and dynamic plot in the console.

> [!NOTE]
> See
> [Input Filter](../../interfaces/web/controls.md#input-filter)

## Linker Tool

Alternatively, you can use the Linker tool to pair the dynamic plot with a table by clicking the **Open Linker Tool** button in the console, or choose the Linker option from the **Controls** menu.

Connect the input column (in this case, "USym") button in the dynamic plot to the matching column in the trigger table. Double-clicking on any row in the trigger table will filter the target (the dynamic plot) to match the input column's value in that row.

![Creating a plot using the Linker tool](../../assets/plotting/linker.gif)

> [!NOTE]
> See
> [Linker](../../interfaces/web/controls.md#linker)

To clear your selections, open the Linker from the **Controls** menu and choose **Clear All**.

## Related documentation

- [Legacy Plotting chart types](./legacy-plotting.md)
