When I generate vector graphics using CairoMakie
, very often in the output figure (in .pdf
) the axis numbers, labels and text (using text!()
or Label()
) consists of numbers and words which are ‘disconnected’ when I inspect the figure in Illustrator or Inkscape. By ‘disconnected’, I mean I can’t select the whole number or text as one single text object. Instead, they appear as separate text object. For example, when I create the following figure:
using CairoMakie, Pkg
Pkg.status(["CairoMakie"]) #v0.10.7
function create_demo(savename; font="Arial")
set_theme!()
update_theme!(Theme(fonts = (; regular = font)))
fig = Figure(resolution=(1000,400))
ax1 = Axis(fig[1,1])
x1 = range(0, 1, length=101)
y1 = sin.(x1)
lines!(ax1, x1, y1)
text!(ax1, 0.05, 0.95, text="label for testing", space=:relative)
save(savename*".pdf", fig, pt_per_unit=1)
return fig
end
@time create_demo("testing")
When I open it in Illustrator, I can’t highlight the whole ‘0.0’ in the x-axis label. ‘0.’ appear as one object, and the decimal ‘0’ appear as a separate object. Same when I just to select the text ‘label for testing’. The five alphabets in ‘label’ appear as five separate text, then ‘for’ as one text, ‘sting’ as one text. Sometimes it does output the whole thing as one text, e.g. ‘1.0’.
My question is are there ways to make it output each set of words or numbers as one text object? How does the program determine this?