# Subplots woes with plotlyjs backend

**URL:** <https://discourse.julialang.org/t/subplots-woes-with-plotlyjs-backend/19390>\
**Category:** Visualization\
**Created:** [January 8, 2019, 3:45pm UTC](https://discourse.julialang.org/t/subplots-woes-with-plotlyjs-backend/19390 "2019-01-08T15:45:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohsonice](https://avatars.discourse-cdn.com/v4/letter/o/d6d6ee/32.png) [@ohsonice](https://discourse.julialang.org/u/ohsonice)\
**Post date:** [January 8, 2019, 3:45pm UTC](https://discourse.julialang.org/t/subplots-woes-with-plotlyjs-backend/19390/1 "2019-01-08T15:45:37Z")

</div>

I’m encountering unexpected behavior when attempting to plot subplots with the plotlyjs backend. Minimal example:

```julia
using Plots
plotlyjs()
plot(rand(100,4),layout=4)

```

The output produced is below. The first plot is huge and the next three overlay it. ![newplot](https://global.discourse-cdn.com/julialang/original/3X/0/3/03a7747486a5d98651a36d87529ff31c1906ae60.png)

Apologies if I am missing something simple. I am using:

```julia
julia version 1.0.1
[f0f68f2c] PlotlyJS v0.12.2
[91a5bcdd] Plots v0.22.4

```

I have done a `Pkg.update()` and `Pkg.resolve()`. Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![Noel\_Araujo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/noel_araujo/32/4862_2.png) [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Post date:** [January 17, 2019, 1:54pm UTC](https://discourse.julialang.org/t/subplots-woes-with-plotlyjs-backend/19390/2 "2019-01-17T13:54:58Z")

</div>

I don’t have the same issue as yours with 2D plots, but I have an issue with 3D plots

```julia
plot(
    plot(rand(100), legend = false),
    scatter3d(rand(100), rand(100), rand(100))
    ) |> display

```

![newplot](https://global.discourse-cdn.com/julialang/original/3X/e/8/e8a1457963e7396642c25b949bc86a77d617cadd.png)

I’m open to suggestions

---

<div class="post-metadata">

**Author:** ![Janik](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@Janik](https://discourse.julialang.org/u/Janik)\
**Post date:** [September 2, 2024, 9:49pm UTC](https://discourse.julialang.org/t/subplots-woes-with-plotlyjs-backend/19390/3 "2024-09-02T21:49:34Z")

</div>

I have the same issue:

```julia
using Plots
plotlyjs()
x = 0:100
y1 = @. -4.4 + (0.4 * x)
y2 = @. -4.8 + (0.4 * x)

p1 = plot(x, y1, label="y1")
p2 = plot(x, y2, label="y2")

plot(p1, p2, layout=(1, 2))

```

creates  
 ![weird_plot_behaviour](https://global.discourse-cdn.com/julialang/original/3X/3/f/3f5d9c0da8ab5c9a9565c0849e77cd3b5f58bf0b.png)

Has anybody found a solution for this?

I am using

```julia
Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M3
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

[91a5bcdd] Plots v1.40.8
[f0f68f2c] PlotlyJS v0.18.13

```
