# Contour3D does not work

**URL:** https://discourse.julialang.org/t/contour3d-does-not-work/120914
**Category:** New to Julia
**Tags:** question, plotting
**Created:** [October 4, 2024, 1:45pm UTC](https://discourse.julialang.org/t/contour3d-does-not-work/120914 "2024-10-04T13:45:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![NaSi](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@NaSi](https://discourse.julialang.org/u/NaSi)
#### Post date: [October 4, 2024, 1:45pm UTC](https://discourse.julialang.org/t/contour3d-does-not-work/120914/1 "2024-10-04T13:45:10Z")

</div>

Hello =)  
I am very new to Julia…  
I want to make a simple contour but it doesn’t work ☹

I alwyas have the error : ERROR: Can’t convert to a Vector. Please supply a range/vector/interval

```julia
using GLMakie

function meshgrid(x::AbstractVector, y::AbstractVector)
    X = repeat(x', inner=(length(y), 1)) # Crée une matrice X
    Y = repeat(y', inner=(length(y), 1)) # Crée une matrice Y
    return X, Y
end

x_vals = range(-5, stop=5, length=100)  
y_vals = range(-5, stop=5, length=100) 

X, Y = meshgrid(x_vals, y_vals)

Z = sin.(X .^ 2 + Y .^ 2)  

f = Figure(fontsize=18, font="Times New Roman")
ax1 = Axis3(f[1, 1], aspect = (1, 1, 1),
            xlabel = "x [m]", ylabel = "y [m]", zlabel = "z [m]")
    contour3d!(ax1, X, Y, Z, levels =20)
f

```

Could you help ? =)  
Thanks

---

<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: [October 4, 2024, 2:10pm UTC](https://discourse.julialang.org/t/contour3d-does-not-work/120914/2 "2024-10-04T14:10:52Z")

</div>

You don’t need meshgrid, pass x\_vals and y\_vals directly to contour3d like shown in the docs [contour3d | Makie](https://docs.makie.org/stable/reference/plots/contour3d#contour3d)
