# Makie: overlaying scatter plot onto heatmap in Pluto

**URL:** <https://discourse.julialang.org/t/makie-overlaying-scatter-plot-onto-heatmap-in-pluto/65141>\
**Category:** Visualization\
**Tags:** pluto, makie, wglmakie\
**Created:** [July 22, 2021, 10:00pm UTC](https://discourse.julialang.org/t/makie-overlaying-scatter-plot-onto-heatmap-in-pluto/65141 "2021-07-22T22:00:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dale\_James\_Black](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dale_james_black/32/11595_2.png) [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Post date:** [July 22, 2021, 10:00pm UTC](https://discourse.julialang.org/t/makie-overlaying-scatter-plot-onto-heatmap-in-pluto/65141/1 "2021-07-22T22:00:19Z")

</div>

I am working inside a Pluto notebook with WGLMakie and I have 3D volumes that I scrolling through using a `PlutoUI.Slider` and `heatmap(volume[:, :, b])` where `b` is a Slider element. I have a label (segmentation) that I want to overlay on the heatmap in the form of an array of cartesian coordinates. I got this to work with Plots.jl but it looks really strange when I translate to Makie. Any changes that you see to make this more visually appealing?

Working Plots.jl version

```julia
# Cell 1
zs_l = unique(label_arr[:,3]);

# Cell 2
indices_l = findall(x -> x == zs_l[q], label_arr[:,3])

# Cell 3
@bind q Slider(1:length(zs_l), default=10, show_value=true)

# Cell 4
begin
	plt_lbl = scatter(label_arr[:,1][indices_l], label_arr[:,2][indices_l], color="blue", alpha=0.9, markersize=1)
	heatmap!(plt_lbl, (img_array[:,:,zs_l[q]]), size=(5000, 5000), alpha=0.5, color=:grays)
end

```

Makie version:

```julia
# Cell 1
begin
	sc, layout = layoutscene(resolution = (1200, 1200))
	sc
end

# Cell 2
heatmap!(sc, (img_array[:,:,zs_l[q]]), colormap=:grays)

# Cell 3
scatter!(sc, label_arr[:,1][indices_l], label_arr[:,2][indices_l])

```

---

<div class="post-metadata">

**Author:** ![Dale\_James\_Black](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dale_james_black/32/11595_2.png) [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Post date:** [July 22, 2021, 10:48pm UTC](https://discourse.julialang.org/t/makie-overlaying-scatter-plot-onto-heatmap-in-pluto/65141/2 "2021-07-22T22:48:19Z")

</div>

To answer my own question it’s a simple adjustment

```julia
begin
	sc = Scene()
	heatmap!(sc, (img_array[:,:,zs_l[q]]), colormap=:grays)
	scatter!(sc, label_arr[:,1][indices_l], label_arr[:,2][indices_l])
	sc
end

```
