# PlotlyJS: plot multiple times in the same display window?

**URL:** https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958
**Category:** General Usage
**Tags:** plotlyjs
**Created:** [March 2, 2026, 3:20pm UTC](https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958 "2026-03-02T15:20:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)
#### Post date: [March 2, 2026, 3:20pm UTC](https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958/1 "2026-03-02T15:20:26Z")

</div>

Package specific question.  
Package: PlotlyJS  
Question:  
Hi,  
Is it possible, to plot multiple times in the same plot window?  
Similar to the Plots-behaviour / GKS QtTerm.  
Regards,  
Stefan

---

<div class="post-metadata">

### Author: ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)
#### Post date: [March 2, 2026, 5:45pm UTC](https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958/2 "2026-03-02T17:45:44Z")

</div>

Like this?

> **[Line and Scatter · PlotlyJS](https://juliaplots.org/PlotlyJS.jl/stable/examples/line_scatter/)**
>
> Documentation for PlotlyJS.

---

<div class="post-metadata">

### Author: ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)
#### Post date: [March 2, 2026, 9:28pm UTC](https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958/3 "2026-03-02T21:28:16Z")

</div>

Thanks for the link! - Yes, I like it!  
I spent maybe an our and interrogated some AIchatBOTs, -  
up to now without success ☹

---

<div class="post-metadata">

### Author: ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)
#### Post date: [March 6, 2026, 5:42pm UTC](https://discourse.julialang.org/t/plotlyjs-plot-multiple-times-in-the-same-display-window/135958/4 "2026-03-06T17:42:00Z")

</div>

What about this solution:

```julia-auto
using PlotlyJS
x_vec = collect(0:0.1:10)
y_vec = rand.(length(x_vec))                
trace_object = PlotlyJS.scatter(x = x_vec, y = y_vec,)
layout = PlotlyJS.Layout()

if !@isdefined(p) || p === nothing
    global p = PlotlyJS.plot([trace_object], layout)
else
    PlotlyJS.react!(p, [trace_object], layout)
end

```
