# How to put a single marker on a heatmap

**URL:** https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447
**Category:** Visualization
**Tags:** plotting, makie
**Created:** [June 8, 2022, 4:33pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447 "2022-06-08T16:33:52Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)
#### Post date: [June 8, 2022, 4:33pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/1 "2022-06-08T16:33:52Z")

</div>

I’m using `CairoMakie` to make a heatmap in Julia 1.7.3

I’d like to add a single smiley face (or really any marker) in the very center of the heatmap, at say 50 x 50.

This seems like a super simple task, but I’ve been looking online and haven’t found anything. The most basic thing to do would seem to be use scatter, which I can make work if I have multiple points, but not if I only want to put one.

Can anyone point me in the right direction?

---

<div class="post-metadata">

### Author: ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)
#### Post date: [June 8, 2022, 4:44pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/2 "2022-06-08T16:44:43Z")

</div>

I think your single points just need to be wrapped in a vector:

```julia
using CairoMakie

fig = Figure()
ax = Axis(fig[1, 1])

heatmap!(ax, rand(4, 4))
scatter!(ax, [2.5], [2.5]; marker='😃', markersize=100)

# Can also use a Point
scatter!(ax, Point(3.5, 1.5); marker='😃', markersize=100)

fig

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/4/c41039a3ff68be159ba49fa6507ddb32e476679a.png)

Edit: added an example using Point

---

<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: [June 8, 2022, 6:00pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/3 "2022-06-08T18:00:29Z")

</div>

Or one `Point`

---

<div class="post-metadata">

### Author: ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)
#### Post date: [June 8, 2022, 6:00pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/4 "2022-06-08T18:00:52Z")

</div>

amazing thank you!!

---

<div class="post-metadata">

### Author: ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)
#### Post date: [June 8, 2022, 6:01pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/5 "2022-06-08T18:01:01Z")

</div>

for some reason this did not work for me…

---

<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: [June 8, 2022, 6:02pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/6 "2022-06-08T18:02:50Z")

</div>

What did you try exactly with the Point?

---

<div class="post-metadata">

### Author: ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)
#### Post date: [June 8, 2022, 7:19pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/7 "2022-06-08T19:19:25Z")

</div>

Thanks, added an example using `Point`

Is there a reference somewhere showing the relationship between `Point`, `Point2`, and `Point2f` by the way? I think I saw that `Point2f0` was deprecated at some point (no pun intended), but I have trouble keeping them all straight to be honest 😅

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [June 8, 2022, 9:47pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/8 "2022-06-08T21:47:50Z")

</div>

> [@icweaver](#):
>
> `marker='😃'`

Curious. What happens under the hood so that the smiley ends up in the image (it even changes its line color) as  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/a/5a6552be4d314a66fe592938fe6b7a9d32a6cca3.png)

---

<div class="post-metadata">

### Author: ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)
#### Post date: [June 9, 2022, 5:25pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/9 "2022-06-09T17:25:09Z")

</div>

Not really a reference but here is a quick explanation.

The main type is `Point{N, T}`, where N is an integer and T is the element type. So Point2 is `Point{2, T}`, and `Point2f` is `Point{2, Float32}`.

Point2f0 was the same as Point2f. The naming was in mimicry of the 1f0 notation to denote Float32 literals.

---

<div class="post-metadata">

### Author: ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)
#### Post date: [June 9, 2022, 5:29pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/10 "2022-06-09T17:29:25Z")

</div>

Basically, there are two factors at play - the font and the rendering system. A lot of fonts don’t explicty support empjis, or have simple vector forms as opposed to the complex emojis we are used to.

Furthermore, in GLMakie we render all text in a specific way (signed distance fields) which allows a glyph to be rendered smoothly but loses the color information.

These two factors mean that Makie is not necessarily that good at rendering emojis. If you find a good font, CairoMakie may do better.

---

<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: [June 9, 2022, 6:54pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/11 "2022-06-09T18:54:17Z")

</div>

Cairo cannot render such multicolor glyphs at all. They’d require bit of a special treatment, and as Anshul said, GLMakie’s pipeline can only handle single color anyway. So it’s not likely to ever be added. However if one truly needed to plot emoji markers, one could always get their hands on bitmaps and plot these as scatter markers.

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [June 9, 2022, 7:59pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/12 "2022-06-09T19:59:57Z")

</div>

Thanks. As I said, this was out of curiosity because what was plotted was not the emoji itself but _simplification_ of it. I think Cairo is not so different of GMT (which has its own PostScript library) and in it we can make symbols out of any postscript file, so plotting emojis would be a matter of creating PS versions of them.

---

<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: [June 9, 2022, 8:05pm UTC](https://discourse.julialang.org/t/how-to-put-a-single-marker-on-a-heatmap/82447/13 "2022-06-09T20:05:03Z")

</div>

It’s not a simplification, it’s a different glyph associated with the same unicode character.
