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

group by plot fails when dataframe is accessed by column number #485

Open
kafisatz opened this issue Jul 11, 2024 · 0 comments
Open

group by plot fails when dataframe is accessed by column number #485

kafisatz opened this issue Jul 11, 2024 · 0 comments

Comments

@kafisatz
Copy link

kafisatz commented Jul 11, 2024

Describe the bug
For the first plot below, the wrong data is plotted for the second group of data.

Accessing the column by name does not help either df[!,somecolumnname yields identical results as df[!,1] for me.

using PlotlyBase
import PlotlyJS
using DataFrames 

df = DataFrame(a=1:4,b=["a","a","b","b"],timeaxis=[1,2,1,2])

#does not work
#data for both lines **coincides** - why?
plt0 = scatter(df, group=:b, y=df[!,1], x=:timeaxis, mode="lines+markers") 
PlotlyJS.plot(plt0, PlotlyBase.Layout(;title=""))

#works
plt0 = scatter(df, group=:b, y=:a, x=:timeaxis, mode="lines+markers")
PlotlyJS.plot(plt0, PlotlyBase.Layout(;title=""))
julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd4843 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 32 × AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 16 default, 0 interactive, 8 GC (on 32 virtual cores)
Environment:
  JULIA_EDITOR = "code"
  JULIA_NUM_THREADS = 16

julia> using Pkg; pkg"status"
Status `C:\Users\bernhard.konig\.julia\environments\v1.10\Project.toml`
  [6e4b80f9] BenchmarkTools v1.5.0
  [14b8a8f1] PkgTemplates v0.7.51
  [295af30f] Revise v3.5.15

julia>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant