Skip to content

Colors in legend are broken for arrows2d() #5527

@AdamWysokinski

Description

@AdamWysokinski
(@v1.12) pkg> st -m Makie
Status `~/.julia/environments/v1.12/Manifest.toml`
  [ee78f7c6] Makie v0.24.8

(@v1.12) pkg> st -m GLMakie
Status `~/.julia/environments/v1.12/Manifest.toml`
  [e9467ef8] GLMakie v0.13.8

As in the title, colors are broken in legend:

using GLMakie
p = GLMakie.Figure()
ax = GLMakie.Axis(p[1, 1],
                  aspect=1)
GLMakie.xlims!(ax, (-4, 4))
GLMakie.ylims!(ax, (-4, 4))

n = 10
l = rand(n, 2)
cmap = GLMakie.resample_cmap(:viridis, n)
for idx in 1:n
    GLMakie.arrows2d!((0, 0),
                      (l[idx, 1], l[idx, 2]),
                      color=cmap[idx],
                      colormap=:viridis,
                      colorrange=1:n,
                      label=string.(idx))
end
axislegend(position=:rt)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions