Makie - arrowhead options

Hello!
I am drawing an arrows plot in GLMakie,
Where can I find a list of the legal inputs to the arrowhead keyword?

yoplo

Hi. Generally for the 2D case that can be any character:

julia> arrows(xs, ys, us, vs, arrowsize = 10, lengthscale = 0.3,
           arrowcolor = strength, linecolor = strength, arrowhead='H')

But, probably you are referring to a marker list as you can find here Page Redirection

# eg
julia> arrows(xs, ys, us, vs, arrowsize = 10, lengthscale = 0.3,
           arrowcolor = strength, linecolor = strength, arrowhead=:rect)

Disclaimer

Also GLMakie is just the backend used to print your visualization. The core functionality you are asking about is defined generally for Makie.jl and holds for all backends (e.g.CairoMakie, WGLMakie`, …)

1 Like

Thank you for the quick reply!
I thought arrow heads would have their own markers…
How then would I make a standard arrow like this: ---->
?

Not setting the arrowhead will draw a standard arrow like the example here arrows · Makie
Or using arrowhead='↑' like here

You can use whatever you want, arrowheads are reasonably easy to make yourself if you want a specific one:

julia> begin
       f = Figure(resolution = (800, 800))
       Axis(f[1, 1], backgroundcolor = "black")

       xs = LinRange(0, 2pi, 20)
       ys = LinRange(0, 3pi, 20)
       us = [sin(x) * cos(y) for x in xs, y in ys]
       vs = [-cos(x) * sin(y) for x in xs, y in ys]
       strength = vec(sqrt.(us .^ 2 .+ vs .^ 2))

       arrowpoly = Makie.Polygon(Point2f[(0, 1), (0.5, -0.3), (0, 0), (-0.5, -0.3)])

       arrows!(xs, ys, us, vs, arrowsize = 10, lengthscale = 0.3,
           arrowcolor = strength, linecolor = strength, arrowhead = arrowpoly)

       f
       end

1 Like