Skip to main content

PlotlyAddTraces

Wolfram Kernel
Execution environment
Notebook`Kernel`PlotlyExtension`
Context
PlotlyAddTraces[p_PlotInstance, {data_Association} | _Association]

appends to a plot p new data specified in data.

Example

Plot an example data

p = Plotly[<|
"x" -> Range[100],
"y" -> Table[Sin[2Pi x / 100.0], {x,100}],
"mode" -> "line"
|>]

To dynamically add new traces, we can call directly

PlotlyAddTraces[p, <|
"x" -> Range[100],
"y" -> Table[Cos[4Pi x / 100.0], {x,100}]
|>]