# Plotting a 3D Surface

**URL:** <https://discourse.julialang.org/t/plotting-a-3d-surface/17143>\
**Category:** New to Julia\
**Created:** [November 4, 2018, 7:23pm UTC](https://discourse.julialang.org/t/plotting-a-3d-surface/17143 "2018-11-04T19:23:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [November 4, 2018, 8:07pm UTC](https://discourse.julialang.org/t/plotting-a-3d-surface/17143/2 "2018-11-04T20:07:25Z")

</div>

It is not quite clear to me what the question is. However, you can use `Plots` as follows:

```plaintext
using Plots; pyplot()
x=range(-2,stop=2,length=100)
y=range(sqrt(2),stop=2,length=100)
f(x,y) = x*y-x-y+1
plot(x,y,f,st=:surface,camera=(-30,30))

```

with result:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/c/3c4bddb8ab8cffc2095ddc81d9c755d5d31b1e5e.jpeg)  
Here, `st` is short hand for `seriestype` (or something similar). Keyword `camera` sets the camera/viewing angles. I have used the default heatmap.  
If you want to plot contours, you can plot contour lines (`st=:contour`) or filled countours (`st=:contour`).

---

_[View the full topic](https://discourse.julialang.org/t/plotting-a-3d-surface/17143)._
