# How to make GLMakie's Volume function look like a solid

**URL:** <https://discourse.julialang.org/t/how-to-make-glmakies-volume-function-look-like-a-solid/137090>\
**Category:** General Usage\
**Tags:** glmakie\
**Created:** [May 12, 2026, 7:58pm UTC](https://discourse.julialang.org/t/how-to-make-glmakies-volume-function-look-like-a-solid/137090 "2026-05-12T19:58:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhai](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jhai](https://discourse.julialang.org/u/jhai)\
**Post date:** [May 12, 2026, 7:58pm UTC](https://discourse.julialang.org/t/how-to-make-glmakies-volume-function-look-like-a-solid/137090/1 "2026-05-12T19:58:37Z")

</div>

I’m trying to visualize a solid 3d object using GLMakie’s volume function:

```julia-auto
using GLMakie

n = 150 # Resolution

x = range(0, 1, length=n)
y = range(0, 1, length=n)
z = range(0, 1, length=n)

vol = [ (0 ≤ xi ≤ 1 && 0 ≤ yi ≤ sqrt(xi) && 0 ≤ zi ≤ yi) ? 1.0 : 0.0 
        for xi in x, yi in y, zi in z ]

fig = Figure(size = (1400, 800))
ax = LScene(fig[1, 1])

volume!(ax, vol,
    algorithm = :iso,
    isorange = 0.05,
    isovalue = 0.7,
)

display(fig)
wait(display(fig))

```

However the resulting object doesn’t look nice, even after playing around with the parameters:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/b/6b270f7d63b11f1afcd957ab010d6346e4db141a.jpeg)

One can see that two of the four faces are missing, and the faces that are there look like a bunch of points instead of one compact surface.

How can I make it look better?

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [May 12, 2026, 9:44pm UTC](https://discourse.julialang.org/t/how-to-make-glmakies-volume-function-look-like-a-solid/137090/2 "2026-05-12T21:44:23Z")

</div>

You’re plotting the `vol .= 0.7` isovolume, but `vol` has values of only 0 and 1, so you’re trying to plot an infinitesimally thin surface as a volume. Instead, try plotting with a colormap that sets values of zero to be transparent, e.g. `volume(vol, colormap=[RGBAf(0,0,0,0), RGBAf(0.5,0,1,1)])`, or look at [voxel plots](https://docs.makie.org/dev/reference/plots/voxels): `voxels(vol, is_air = x -> x < 0.5, color=:white)`

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/e/de8285441f9265a6965236fa2ab1476303545c41.png)
