# GLMakie: volume plot for nonuniform grid

**URL:** <https://discourse.julialang.org/t/glmakie-volume-plot-for-nonuniform-grid/115913>\
**Category:** Visualization\
**Tags:** makie, glmakie\
**Created:** [June 20, 2024, 9:40am UTC](https://discourse.julialang.org/t/glmakie-volume-plot-for-nonuniform-grid/115913 "2024-06-20T09:40:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedoroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fedoroff/32/53209_2.png) [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Post date:** [June 20, 2024, 9:40am UTC](https://discourse.julialang.org/t/glmakie-volume-plot-for-nonuniform-grid/115913/1 "2024-06-20T09:40:32Z")

</div>

After the recent Makie update the volume plots show the deprecation warning if you pass arrays as the coordinates for the axes:

```julia
import GLMakie as mak

x = y = range(-10, 10, 101)
z = range(-5, 5, 101)
F = [exp(-(xi^2 + yi^2 + zi^2) / 2^2) for xi=x, yi=y, zi=z]

fig = mak.Figure()
ax = mak.Axis3(fig[1,1])
# mak.volume!(ax, x, y, z, F) # deprecation warning
mak.volume!(ax, (-10,10), (-10,10), (-5,5), F) # fine
# mak.volume!(ax, -10..10, -10..10, -5..5, F) # `..` not defined
mak.display(fig)

```

The deprecation warning says:

```julia
Encountered an `AbstractVector` with value -10.0:0.2:10.0 on side x in `convert_arguments` for the `ImageLike` trait.
     Using an `AbstractVector` to specify one dimension of an `ImageLike` is deprecated because `ImageLike` sides always need exactly two values, start and stop.
     Use interval notation `start .. stop` or a two-element tuple `(start, stop)` instead.

```

What if I have a nonuniform grid? Should I manually make an interpolation before the plotting?

P.S. By the way, the interval notation proposed in the deprecation warning results in ` `..` not defined` error.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [June 20, 2024, 11:00am UTC](https://discourse.julialang.org/t/glmakie-volume-plot-for-nonuniform-grid/115913/2 "2024-06-20T11:00:54Z")

</div>

Makie Exports `..` but doesn’t of course if you only import it.  
Yes, you need to manually interpolate right now, the deprecation warning could be improved, but basically we never supported irregular grids for volumes and we just took the endpoints since the API was just passing it through and we took the conversion pipeline from heatmap for volume before!

---

<div class="post-metadata">

**Author:** ![fedoroff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fedoroff/32/53209_2.png) [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Post date:** [June 20, 2024, 12:25pm UTC](https://discourse.julialang.org/t/glmakie-volume-plot-for-nonuniform-grid/115913/3 "2024-06-20T12:25:25Z")

</div>

OK. Thank you.
