Subplots woes with plotlyjs backend

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

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

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

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!

1 Like

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

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

newplot

I’m open to suggestions

1 Like

I have the same issue:

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

Has anybody found a solution for this?

I am using

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