# Reuse PlotlyJS Blink window

**URL:** https://discourse.julialang.org/t/reuse-plotlyjs-blink-window/69728
**Category:** General Usage
**Tags:** plotlyjs
**Created:** [October 14, 2021, 4:53am UTC](https://discourse.julialang.org/t/reuse-plotlyjs-blink-window/69728 "2021-10-14T04:53:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)
#### Post date: [October 14, 2021, 4:53am UTC](https://discourse.julialang.org/t/reuse-plotlyjs-blink-window/69728/1 "2021-10-14T04:53:47Z")

</div>

Very basic question: when using PlotlyJS with the Blink display window, how can I get subsequent calls to `plot()` to reuse the same Blink window rather than opening new windows?

---

<div class="post-metadata">

### Author: ![RGerzaguet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rgerzaguet/32/45492_2.png) [@RGerzaguet](https://discourse.julialang.org/u/RGerzaguet)
#### Post date: [October 14, 2021, 8:50am UTC](https://discourse.julialang.org/t/reuse-plotlyjs-blink-window/69728/2 "2021-10-14T08:50:42Z")

</div>

Hello,  
One way is first to call ` deletetraces!(p,0);` and then `addtrace!(p,plt)` where plt is the plot.

A simple example

```julia
using PlotlyJS
# Data 
x = 1:10
y = randn(10)
# Plotting data 
pl1 = PlotlyJS.scatter(; x,y, name=" ");
p = PlotlyJS.plot(pl1)
# New data and update plot 
y = randn(10)
deletetraces!(p,0);
pl1 = PlotlyJS.scatter(; x,y, name=" ");
addtraces!(p,pl1)

```
