JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
413 stars 77 forks source link

Error bars (`yerror`) are still displayed even if the plot is disabled #436

Open LebedevRI opened 2 years ago

LebedevRI commented 2 years ago

Describe the bug Small self-contained example:

using Plots
plotlyjs();

scatter([0], [0])

results in: newplot Clicking on y1 in legend results in: newplot (1) The entirety of the plot was hidden. All good so far.

Now, second example:

using Plots
plotlyjs();

scatter([0], [0], yerror=1)

results in: newplot (2) Cool, there's now error bars. But, let's see what happens upon clicking on y1 in legend: newplot (3) The error bars are still drawn, even though the plot no longer is. This seems like a bug, although i'm not sure if PlotlyJS is to blame.

Version info

julia> versioninfo()
Julia Version 1.8.0-beta3
Commit 3e092a2521 (2022-03-29 15:42 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 32 × AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 32 on 32 virtual cores

julia> using Pkg; pkg"status"
Status `~/.julia/environments/v1.8/Project.toml`
  [a93c6f00] DataFrames v1.3.4
  [31c24e10] Distributions v0.25.59
  [38e38edf] GLM v1.7.0
  [28b8d3ca] GR v0.64.3
  [7073ff75] IJulia v1.23.3
  [2fda8390] LsqFit v0.12.1
  [eff96d63] Measurements v2.7.2
  [58dd65bb] Plotly v0.4.1
  [f0f68f2c] PlotlyJS v0.18.8
  [91a5bcdd] Plots v1.29.0
  [f27b6e38] Polynomials v3.0.1
  [276daf66] SpecialFunctions v2.1.5
  [f3b207a7] StatsPlots v0.14.34
  [1986cc42] Unitful v1.11.0
  [42071c24] UnitfulRecipes v1.5.3

julia> 
jeffpollock9 commented 2 years ago

I also found this quite surprising - in the short term is anyone aware of a workaround? Thanks!