# Drawing an outline around one data point in heatmap

**URL:** <https://discourse.julialang.org/t/drawing-an-outline-around-one-data-point-in-heatmap/89820>\
**Category:** Visualization\
**Tags:** plotting, makie\
**Created:** [November 5, 2022, 6:32pm UTC](https://discourse.julialang.org/t/drawing-an-outline-around-one-data-point-in-heatmap/89820 "2022-11-05T18:32:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Post date:** [November 5, 2022, 6:32pm UTC](https://discourse.julialang.org/t/drawing-an-outline-around-one-data-point-in-heatmap/89820/1 "2022-11-05T18:32:07Z")

</div>

Suppose I have a heatmap created using `Makie.jl`:

```julia
data = rand(10,10)

fig = Figure()
ax = Axis(fig[1,1], aspect=1)
hm = heatmap!(ax, data)

fig

```

The heatmap is essentially 10x10 rectangles with different colors. How do I draw a rectangle around the rectangle of a specified data point, e.g. at `(x,y)=(3,3)`?

Using something like `scatter!(ax, 3, 3, marker=:rect, color=:black)` doesn’t quite work because it’s hard to control the markersize and more importantly the symbol is filled, masking the color of the heatmap data point. I just want to draw an outline around the data point.

---

<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:** [November 5, 2022, 8:46pm UTC](https://discourse.julialang.org/t/drawing-an-outline-around-one-data-point-in-heatmap/89820/2 "2022-11-05T20:46:34Z")

</div>

Don’t draw a symbol, draw a polygon (rectangle) with the wished coordinates.

---

<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:** [November 5, 2022, 8:46pm UTC](https://discourse.julialang.org/t/drawing-an-outline-around-one-data-point-in-heatmap/89820/3 "2022-11-05T20:46:53Z")

</div>

You can do `wireframe!(ax, Rect2f(origin, widths))` or `BBox(left, right, bottom, top)` (alternative Rect constructor.
