# Looking for a simple surface plot with Makie

**URL:** <https://discourse.julialang.org/t/looking-for-a-simple-surface-plot-with-makie/41101>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 9, 2020, 11:08pm UTC](https://discourse.julialang.org/t/looking-for-a-simple-surface-plot-with-makie/41101 "2020-06-09T23:08:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 9, 2020, 11:08pm UTC](https://discourse.julialang.org/t/looking-for-a-simple-surface-plot-with-makie/41101/1 "2020-06-09T23:08:43Z")

</div>

This is what I tried:

```julia
using Makie, GeometryBasics, Colors

surface([0.0, 1.0, 2.0], [0.0, 1.0, 2.0], rand(9))

```

and I’m getting:

```julia
julia> surface([0.0, 1.0, 2.0], [0.0, 1.0, 2.0], rand(9))
ERROR: There was no `AbstractPlotting.convert_arguments` overload found for
the plot type Surface{...}, or its conversion trait AbstractPlotting.SurfaceLike().
The arguments were:
(Array{Float64,1}, Array{Float64,1}, Array{Float64,1})

To fix this, define `AbstractPlotting.convert_arguments(::Surface{...}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1})`.

```

I can’t figure out from the documentation what parameter types are allowed. The example I cut and pasted from examples3d.jl:

```julia
    N = 30
    function xy_data(x, y)
        r = sqrt(x^2 + y^2)
        r == 0.0 ? 1f0 : (sin(r)/r)
    end
    r = range(-2, stop = 2, length = N)
    surf_func(i) = [Float32(xy_data(x*i, y*i)) for x = r, y = r]
    scene = surface(
        r, r, surf_func(10),
        color = rand(RGBAf0, 124, 124)
    )

```

produces a similar an error too.

---

<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:** [June 10, 2020, 4:24am UTC](https://discourse.julialang.org/t/looking-for-a-simple-surface-plot-with-makie/41101/2 "2020-06-10T04:24:58Z")

</div>

I think the problem in your first example is that z is a vector and not a matrix. And in the second one z is a matrix which is good, but your color array has size (124, 124) while your x and y vectors have length 30.

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 10, 2020, 4:42am UTC](https://discourse.julialang.org/t/looking-for-a-simple-surface-plot-with-makie/41101/3 "2020-06-10T04:42:14Z")

</div>

Thank you. Indeed, matrix makes more sense as the 3rd argument. This:

```julia
surface(1:3, 1:3, rand(3, 3))

```

works as intended. I just couldn’t parse the error message. The second example was copied from [MakieGallery.jl/examples3d.jl at master · JuliaPlots/MakieGallery.jl · GitHub](https://github.com/JuliaPlots/MakieGallery.jl/blob/master/examples/examples3d.jl)
