# Why does \`relayout!(p, template=...)\` get overwritten by next \`relayout!\`?

**URL:** <https://discourse.julialang.org/t/why-does-relayout-p-template-get-overwritten-by-next-relayout/75536>\
**Category:** Visualization\
**Tags:** plotlyjs\
**Created:** [January 31, 2022, 8:30pm UTC](https://discourse.julialang.org/t/why-does-relayout-p-template-get-overwritten-by-next-relayout/75536 "2022-01-31T20:30:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mo-Gul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mo-gul/32/33308_2.png) [@Mo-Gul](https://discourse.julialang.org/u/Mo-Gul)\
**Post date:** [January 31, 2022, 8:30pm UTC](https://discourse.julialang.org/t/why-does-relayout-p-template-get-overwritten-by-next-relayout/75536/1 "2022-01-31T20:30:18Z")

</div>

For the code

```nohighlight
p = make_subplots(
    rows=2,
    cols=1,
    shared_xaxes=true,
)

add_trace!(p, scatter(y=1:2), row=1, col=1)
add_trace!(p, scatter(y=1:2), row=2, col=1)

relayout!(
    p,
    template="plotly_white",
)
relayout!(
    p,
    xaxis=attr(showlines=true, mirror=true, linewidth=2),
    yaxis=attr(showlines=true, mirror=true, linewidth=2, linecolor="red"),
)

```

I would have expected that the second `relayout!` **updates** the layout, but instead it seems to be reset. How can I prevent this?

(In Python one would first set the template default with

```python
import plotly.io as pio

pio.templates.default = "plotly_white"

```

then this doesn’t seem to happen. Unfortunately I couldn’t find an equivalent command in Julia yet.)
