# Scatter plot points visable even if behind a mesh plot

**URL:** https://discourse.julialang.org/t/scatter-plot-points-visable-even-if-behind-a-mesh-plot/130569
**Category:** Visualization
**Tags:** cairomakie
**Created:** [July 9, 2025, 7:45am UTC](https://discourse.julialang.org/t/scatter-plot-points-visable-even-if-behind-a-mesh-plot/130569 "2025-07-09T07:45:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Varun\_V](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/varun_v/32/53199_2.png) [@Varun\_V](https://discourse.julialang.org/u/Varun_V)
#### Post date: [July 9, 2025, 7:45am UTC](https://discourse.julialang.org/t/scatter-plot-points-visable-even-if-behind-a-mesh-plot/130569/1 "2025-07-09T07:45:33Z")

</div>

Hi everyone,

I’m encountering different transparency behavior between CairoMakie and GLMakie when combining scatter plots with mesh plots.

Expected behavior: scatter plot points behind a mesh should be hidden (like in GLMakie).

Observed behavior: in CairoMakie, the points behind the mesh remain fully visible.

Is there a way to get the expected behavior though CairoMakie? I need to make the plots on a cluster in which GLMakie is not available.

Example:

```julia
using CairoMakie, FileIO, GeometryBasics 
# switch to GLMakie for expected outcome 

mesh = load(assetpath("brain.stl"))  
v = coordinates(mesh)
f = faces(mesh) 

pltrand = v[rand(eachindex(v), 10)]

fig = Figure();
ax = Axis3(fig[1, 1], aspect=:data)

mesh!(ax, v, f, color=:lightblue)
scatter!(ax, pltrand, color=:red)

fig

```

---

<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: [July 9, 2025, 8:00am UTC](https://discourse.julialang.org/t/scatter-plot-points-visable-even-if-behind-a-mesh-plot/130569/2 "2025-07-09T08:00:35Z")

</div>

CairoMakie has no z buffer, like all 2D drawing engines it just layers things on top of each other, one at a time. Sometimes this works for 3D content, sometimes not. You could try WGLMakie if GLMakie doesn’t work, or look into software emulation of a graphics card like `xvfb` which we also use in Github Actions.
