Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [PlotlyJS] link=:both will unexpectedly make subplots layout with same origin #4796

Open
FelipeLema opened this issue Jul 25, 2023 · 0 comments

Comments

@FelipeLema
Copy link

Details

the following mwe will not plot correctly: p1 and p2 share origin and they shouldn't; they should be stacked one over the other

using Plots
plotlyjs() # works with `gr()`
let y1 = cumsum(rand(20)),
    y2 = cumsum(rand(20)),
    y3 = cumsum(rand(20)),
    y4 = cumsum(rand(20)),
    x = collect(1:20)

    p1 = plot(x, hcat(y1, y2), lab=["y1" "y2"])
    p2 = plot(x, hcat(y3, y4), lab=["y1" "y2"])
    plot(p1, p2, layout=(2, 1), link=:both)
end

image

as reference, here's the same plot with gr(). Looks as expected.
image

Do notice the link=:both. For the real version of this same code I want to explore plots with synchronized axis (xref #1371 )

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version:

(project) pkg> st -m Plots
Project project v0.1.0
Status `~/dev/project/Manifest.toml`
  [91a5bcdd] Plots v1.38.17

Backend version (]st -m <backend(s)>):

(project) pkg> st -m PlotlyJS
Project project v0.1.0
Status `~/dev/project/Manifest.toml`
  [f0f68f2c] PlotlyJS v0.18.10

Output of versioninfo():

Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i5-3340 CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, ivybridge)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants