I am just wondering how to add captions to figures in Makie, as highlighted in the following picture in red? I tried annotations() and text() but the effect are not satisfactory. Maybe I used them in a wrong way. Anyone may help me out? Thanks!
This is a job for the document generator like LaTeX or Franklin.jl, not Makie.
You can put a big block of text into a Figure with
Label, but it doesn’t have text styling beyond a single font.
We can use Unicode bold math letters
f = Figure(resolution=(300, 200))
Label(f[2,1], "𝗙𝗶𝗴𝘂𝗿𝗲 𝟭 A few random values")
How could we do that using text!() ? I wrote the following code under Julia 1.7.0 and
CairoMakie 0.6.6，the text is always in the plotting area.
text!("This is caption.", position = (0, -10))
Thanks! This is cool!
I still have 2 more questions:
- how to make Figure 1 to be bold face?
- if I want the caption to be left-aligned, how could I do that? I tried in the following code under Julia 1.7.0 and CairoMakie 0.6.6, but the result is weird.
fig = Figure(resolution = (600, 600))
Label(fig[2,1, TopLeft()], "This is a caption.",
tellheight = true)
there’s Zalgo.jl as well.
Ah nice! but it seems it doesn’t support digits, e.g.
boldsans("Figure 1") returns
"𝗙𝗶𝗴𝘂𝗿𝗲 " ?
Oh, good point. I will add them in the next release.
Many thanks! it works fine for me
I found Makie’s document is comprehensive but lack of organization with many details spattering around everywhere…
Always good to make an issue if you don’t find something! It grows kind of organically, so sometimes the structure needs to be refactored