Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created July 13, 2022 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkrumbiegel/2228898edc42caff18cedb994bc9be43 to your computer and use it in GitHub Desktop.
Save jkrumbiegel/2228898edc42caff18cedb994bc9be43 to your computer and use it in GitHub Desktop.
f = Figure()
ax = Axis(f[1, 1])
sc = scatter!(randn(10, 2), label = "Points")
text!(randn(10, 2), text = ["hey" for _ in 1:10], color = :red)
leg = Legend(f[1, 2], [sc, []], ["Points", "Location of heys"])
legscene = leg.blockscene.children[1]
leg.grid[1, 1][2, 1] = Label(legscene, "hey", color = :red)
notify(leg.margin) # adjust to new legend size without relayout
f
@jkrumbiegel
Copy link
Author

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment