unsafe_update_figure Chart Customization

To customize a chart in a way that is not directly supported by Deephaven Plotly Express (dx), use the unsafe_update_figure parameter.
\\ Every dx chart is backed by a Plotly Figure. This object gets passed to unsafe_update_figure where it can be modified directly. See the Plotly Figure Reference docs for details on available Figure properties.

Warning

Update figure is marked “unsafe” because some modifications can entirely break your figure, and care must be taken.
\\ dx maps Table columns to an index of a trace within Figure.data which will break if the trace order changes. Do not remove traces. Add new traces at the end of the list.

unsafe_update_figure accepts a function that takes a Plotly Figure object as input and optionally returns a modified Figure object. If a Figure is not returned, it is assumed that the input Figure has been modified in place.

Examples

Bar Line

Add a line to bars in a bar plot with update_traces.

Unsafe Update Figure Example

Legend Location

Change the location of the legend to the bottom of the plot by updating the layout.

Vertical Line

Add a vertical line to a plot with add_vline.

Between Line Fill

Fill the area between lines in a line plot with fill="tonexty".