MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.43k stars 313 forks source link

Datashader with more than 7 categories -> BoundsError in wong_colors #4345

Open behinger opened 2 months ago

behinger commented 2 months ago

When running datashader with more than 7 categories, one runs into https://github.com/MakieOrg/Makie.jl/blob/ae8c1a455b20586febab682bc709a4ddd60d935f/src/basic_recipes/datashader.jl#L460

which boils down to

Makie.wong_colors()[8]

which returns

ERROR: BoundsError: attempt to access 7-element Array{RGBA{Float32},1} with eltype ColorTypes.RGBA{Float32} at index [8]

MWE

using GLMakie
p = rand(Point2f,100)
c = rand(1:8,100)
datashader(c,p)

changing c to 1:7 works.


It would be nice to be able to change the colorscheme too :)

asinghvi17 commented 2 months ago

We should probably have a colormap or palette attribute to datashader which one can pass these colors to...

ffreyer commented 2 months ago

Related: #4160