# Circle surface

**URL:** <https://discourse.julialang.org/t/circle-surface/40094>\
**Category:** New to Julia\
**Tags:** question, plotting\
**Created:** [May 24, 2020, 8:10pm UTC](https://discourse.julialang.org/t/circle-surface/40094 "2020-05-24T20:10:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venom](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@Venom](https://discourse.julialang.org/u/Venom)\
**Post date:** [May 24, 2020, 8:10pm UTC](https://discourse.julialang.org/t/circle-surface/40094/1 "2020-05-24T20:10:24Z")

</div>

Hi, I make first steps in Julia and I want to do circle surface. I can only makes surface on rectangles field in 3D. I will be really thankfull for tips.  
I attach photo, what it should look like ![image](https://global.discourse-cdn.com/julialang/original/3X/d/3/d38f666cfd601411956e0c7cbec2227b2b67f0aa.png)

---

<div class="post-metadata">

**Author:** ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Post date:** [May 24, 2020, 8:34pm UTC](https://discourse.julialang.org/t/circle-surface/40094/2 "2020-05-24T20:34:27Z")

</div>

Do you mean something like in these examples? [https://lazarusa.github.io/gnuplot-examples/menu2/#spheres](https://lazarusa.github.io/gnuplot-examples/menu2/#spheres)

---

<div class="post-metadata">

**Author:** ![Venom](https://avatars.discourse-cdn.com/v4/letter/v/8c91f0/32.png) [@Venom](https://discourse.julialang.org/u/Venom)\
**Post date:** [May 24, 2020, 8:39pm UTC](https://discourse.julialang.org/t/circle-surface/40094/3 "2020-05-24T20:39:24Z")

</div>

not quite, I need to make a 2D wheel in 3D

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/9/8959787ed1ad9e1c0a2d70b2bb983acf09ff7d31.png)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [May 25, 2020, 2:21am UTC](https://discourse.julialang.org/t/circle-surface/40094/4 "2020-05-25T02:21:32Z")

</div>

I’m not sure if you can do that with quadrilaterals, but Makie.jl can plot triangular meshes in 3D.

EDIT: See e.g. the [example gallery](http://makie.juliaplots.org/dev/)

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [May 30, 2020, 2:13am UTC](https://discourse.julialang.org/t/circle-surface/40094/5 "2020-05-30T02:13:08Z")

</div>

You can actually do this by passing matrices of `x, y` to `surface` - this is something that I do all the time in GeoMakie.

Consider this example of a sphere.

```julia
n = 20
θ = [0;(0.5:n-0.5)/n;1]
φ = [(0:2n-2)*2/(2n-1);2]
x = [cospi(φ)*sinpi(θ) for θ in θ, φ in φ]
y = [sinpi(φ)*sinpi(θ) for θ in θ, φ in φ]
z = [cospi(θ) for θ in θ, φ in φ]
surface(x, y, z)

```

If you want a flat sphere, you can just make the `z` values 0.
