# How to make a contour plot from a parametric surface in Makie?

**URL:** <https://discourse.julialang.org/t/how-to-make-a-contour-plot-from-a-parametric-surface-in-makie/95818>\
**Category:** Visualization\
**Tags:** glmakie\
**Created:** [March 9, 2023, 6:30pm UTC](https://discourse.julialang.org/t/how-to-make-a-contour-plot-from-a-parametric-surface-in-makie/95818 "2023-03-09T18:30:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leogabac](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leogabac/32/34345_2.png) [@leogabac](https://discourse.julialang.org/u/leogabac)\
**Post date:** [March 9, 2023, 6:30pm UTC](https://discourse.julialang.org/t/how-to-make-a-contour-plot-from-a-parametric-surface-in-makie/95818/1 "2023-03-09T18:30:32Z")

</div>

Hello!  
Recently for a project I was wondering if there is any way to visualize the contour plot of a parametric surface in Makie. Typically, if I have the explicit expression f(x,y), I can just evaluate in a domain and use the contour (or contourf) functions. However, for my particular case consider as an example this half-sphere.

```julia
using GLMakie
phi = 0:0.01:2π
theta = 0:0.01:π/2
x = [cos(p)*sin(t) for t in theta, p in phi]
y = [sin(p)*sin(t) for t in theta, p in phi]
z = [cos(t) for t in theta, p in phi]
surface(x,y,z)

```

Here I have a parametric sphere, and I would like to get the circles on the x-y plane.

Any ideas on how to do this?

This is my first time asking something in the discourse, I apologize in advance if some details are missing.

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [March 9, 2023, 7:14pm UTC](https://discourse.julialang.org/t/how-to-make-a-contour-plot-from-a-parametric-surface-in-makie/95818/2 "2023-03-09T19:14:40Z")

</div>

The contour plot is associated to a surface of explicit equation, z=f(x,y). In your case you can take z=\sqrt{1-x^2-y^2}, and plot the corresponding contour plot. Due to the symmetry with respect to the plane z=0, the southern hemisphere has the same contour lines.
