Created
March 17, 2020 19:20
-
-
Save jkrumbiegel/f0691fd86c688e385a520d6a8229cab6 to your computer and use it in GitHub Desktop.
faking a legend with multiple sections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Makie | |
using MakieLayout | |
using GLFW; GLFW.WindowHint(GLFW.FLOATING, 1) | |
## | |
scene, layout = layoutscene() | |
ax = layout[1, 1] = LAxis(scene) | |
scats = [scatter!(ax, rand(10, 2), markersize = i * px) for i in 5:5:20] | |
lins = [lines!(ax, rand(10, 2), color = c) for c in [:red, :green, :blue, :orange]] | |
leg1 = LLegend(scene, scats, string.(5:5:20), title = "Sizes", framevisible = false, height = Auto(true), halign = :left) | |
leg2 = LLegend(scene, lins, string.([:red, :green, :blue, :orange]), title = "Sizes", framevisible = false, height = Auto(true)) | |
subgl = layout[1, 2] = vbox!(leg1, leg2; height = Auto(false)) | |
subgl[1:2, 1] = LRect(scene, color = :transparent, strokewidth = 1) | |
scene |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment