# Unicode symbols as arrowheads in Makie

**URL:** <https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [April 5, 2022, 10:13am UTC](https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039 "2022-04-05T10:13:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfrb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kfrb/32/29557_2.png) [@kfrb](https://discourse.julialang.org/u/kfrb)\
**Post date:** [April 5, 2022, 10:13am UTC](https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039/1 "2022-04-05T10:13:00Z")

</div>

Is it possible to use other Symbols for the arrowheads in Makie? According to the docs, the `arrowhead` attribute is set by default to `automatic`, which is in 2D the symbol `"▲"`. To use something like `arrowhead="△"` could be very useful but throws an error when trying to display the figure.

## MWE

This works fine:

```julia
using CairoMakie
positions = Point2f.(rand(5), rand(5))
directions = Vec2f.(rand(5), rand(5))
arrows(positions, directions, arrowsize=15)

```

 ![test](https://global.discourse-cdn.com/julialang/original/3X/8/0/8098f0cdc7be2dc9f33d5643dc46cd10f8e9a2bc.png)

But this throws an error:

```julia
using CairoMakie
positions = Point2f.(rand(5), rand(5))
directions = Vec2f.(rand(5), rand(5))
arrows(positions, directions, arrowsize=15, arrowhead="△")

```

```julia
ERROR: MethodError: no method matching draw_marker(::Cairo.CairoContext, ::String, ::Vec{2, Float32}, ::Vec{2, Float32}, ::ColorTypes.RGBA{Float32}, ::Float32, ::Vec{2, Float32}, ::Quaternionf)
Closest candidates are:
draw_marker(::Any, ::Circle, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/CairoMakie/F9l4g/src/primitives.jl:278
draw_marker(::Any, ::GeometryBasics.HyperRectangle, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/CairoMakie/F9l4g/src/primitives.jl:292
draw_marker(::Any, ::Char, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/CairoMakie/F9l4g/src/primitives.jl:228

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [April 5, 2022, 10:14am UTC](https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039/2 "2022-04-05T10:14:41Z")

</div>

use a `Char` like `'△'` not `"△"`

---

<div class="post-metadata">

**Author:** ![kfrb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kfrb/32/29557_2.png) [@kfrb](https://discourse.julialang.org/u/kfrb)\
**Post date:** [April 5, 2022, 10:21am UTC](https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039/3 "2022-04-05T10:21:33Z")

</div>

Thanks a lot!

```julia
using CairoMakie
positions = Point2f.(rand(5), rand(5))
directions = Vec2f.(rand(5), rand(5))
arrows(positions, directions, arrowsize=15, arrowhead='△')

```

 ![test](https://global.discourse-cdn.com/julialang/original/3X/4/2/42a50d02f30059fbe79591b7ff07ee25d07a6ea6.png)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [April 22, 2022, 9:34pm UTC](https://discourse.julialang.org/t/unicode-symbols-as-arrowheads-in-makie/79039/4 "2022-04-22T21:34:12Z")

</div>

Thanks, wile the solution was simple, and I understand the concept of `Char`\*, would it be appropriate for that package (and most or all others), to also allow 1-letter strings? For the benefit of people coming from e.g. Python where there is no Char, and ‘△’ not “△” would mean the same, a string happens to be 1 Char long.

`*` Char may actually be a bad idea, in Swift since it’s based on grapeme-clusters, they’re “chars” are actually strings, often 1 Char as in Julia, but not always.
