I am writing programs as I attempt to understand jules’ solution shown above. Below is one of my programs …
using CairoMakie
function mainFunction()
figure = Figure()
axis = Axis( figure[1,1], autolimitaspect = 1 )
text!( axis, -5, 0, text = "A", align = (:center, :center), markerspace = :data, fontsize = 1.0 )
text!( axis, 0, 0, text = "B", align = (:center, :center), markerspace = :data, fontsize = 1.0 )
text!( axis, +5, 0, text = "C", align = (:center, :center), markerspace = :data, fontsize = 1.0 )
save( "ABC_ok.png", figure )
end # function mainFunction
mainFunction()
The above program yields …
However, the following program yields …
BoundsError: attempt to access 1-element Vector{Makie.GlyphCollection} at index [2]
using CairoMakie
function mainFunction()
figure = Figure()
axis = Axis( figure[1,1], autolimitaspect = 1 )
xs = [-5,0,+5]
ys = [0,0,0]
text!( axis, xs, ys, text = "ABC", align = (:center, :center), markerspace = :data, fontsize = 1.0 )
save( "ABC_NOT_ok.png", figure )
end # function mainFunction
mainFunction()
It seems that I am using function text!
in the same manner as jules, but getting an error. Might someone see where I am going wrong?