-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
fix legend colorrange #3536
fix legend colorrange #3536
Conversation
New reference images, adapted from OP's bug report: using CairoMakie
main() = begin
f = Figure()
ax = Axis(f[1, 1])
foreach(i -> lines!(ax, i:i+1; colorrange = (1, 4), colormap = :cividis, color = i, label = string(i)), 1:4)
f[1, 2] = Legend(f, ax, "Legend")
save("leg1.png", f)
display(f)
f = Figure()
ax = Axis(f[1, 1])
foreach(i -> lines!(ax, i:i+1; colorrange = (1, 4), colormap = :cividis, color = i, label = string(i)), 1:4)
axislegend(ax)
save("leg2.png", f)
display(f)
f = Figure()
ax = Axis(f[1, 1])
foreach(i -> scatter!(ax, i:i+1, i:i+1; colorrange = (1, 4), colormap = :cividis, color = i, label = string(i), marker = :hexagon), 1:4)
axislegend(ax)
save("leg3.png", f)
display(f)
f = Figure()
ax = Axis(f[1, 1])
foreach(i -> poly!(ax, Rect(i, i, 0.5, 0.25); colorrange = (1, 4), colormap = :cividis, color = i, label = string(i)), 1:4)
axislegend(ax)
save("leg4.png", f)
display(f)
return
end
main() |
This doesn't copy the colormap I think, so it would break if your test didn't use the default. Could you add the same treatment (and tests) for marker and poly elements as well? Then everything would work the same way. |
Good point, I will check that.
Will do. |
@jkrumbiegel , I've updated the examples in #3536 (comment), added reference tests, and fixed propagation of the Does that fix your requests ? |
Thanks again for the PR, I've pushed another PR that does a slightly different variant of this over here #3587 but this helped me get that one done |
Description
Fix #3532.
Type of change
Delete options that do not apply:
Checklist