Plotting overview

In Deephaven, plots can be as live as your data. A Deephaven Express figure updates by itself as its table ticks, so you don't poll for new data or rebuild the figure.

Deephaven supports several ways to plot table data. They differ most in how they handle real-time (ticking) tables, which update as new data arrives:

For most plotting tasks, use Deephaven Express. If you'd rather build a chart from the UI without writing code, see Chart Builder.

Plot a ticking table

Let's plot a ticking table. This example uses time_table to create a table that adds a row every second, then plots it with dx.line from Deephaven Express. The line grows each time a new row arrives, with no extra code:

Plotting library support

The table below compares the options for ticking tables and for static tables, such as historical data. Each library name links to its documentation.

LibraryTicking tablesStatic tablesEase of useInstallation
Deephaven ExpressUpdates nativelyExcellentExcellentpip install deephaven-plugin-plotly-express*
Built-in plotting API (legacy)Updates nativelyGoodGoodBuilt in
MatplotlibFull redrawGoodFairpip install deephaven-plugin-matplotlib*
SeabornFull redrawGoodExcellentpip install "deephaven-plugin-matplotlib[seaborn]"*
PlotlySnapshot onlyGoodGoodInstalled with Deephaven Express

*The ghcr.io/deephaven/server Docker image includes Deephaven Express and the Matplotlib plugin. The machine-learning images don't include them, and neither does a pip install of Deephaven. To add them, see Install and use plugins. The server-slim image runs a Groovy console and has no Python, so it can't use either plugin.

Limitations of copy-based plotting

Matplotlib, Seaborn, and Plotly don't read Deephaven tables directly. They plot a copy of the data, which has two costs:

  • Memory and redraw time: Each update copies table data into Python. By default, TableAnimation and to_pandas copy every column. Pass only the columns you plot to reduce the copy. TableAnimation also redraws the whole figure on every update, so each update gets slower as the table grows.
  • Stale figures: A Plotly figure built from a snapshot shows the data as it was when the snapshot was taken. To see new data, you must build the figure again.

Deephaven Express subscribes to table updates directly, so its figures update as the table ticks without copying the whole table into Python on every change.