# Changing the z-scale in plots3d

**URL:** <https://discourse.julialang.org/t/changing-the-z-scale-in-plots3d/54765>\
**Category:** New to Julia\
**Tags:** visualization\
**Created:** [February 6, 2021, 11:16pm UTC](https://discourse.julialang.org/t/changing-the-z-scale-in-plots3d/54765 "2021-02-06T23:16:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ash](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ash](https://discourse.julialang.org/u/ash)\
**Post date:** [February 7, 2021, 12:19am UTC](https://discourse.julialang.org/t/changing-the-z-scale-in-plots3d/54765/4 "2021-02-07T00:19:50Z")

</div>

Please format your code properly and make sure you read: [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)

Why not just restrict your z-axis to a different range?

```julia
using Plots; pyplot()

plot(size=(600,500))
X(r,theta) = r * cos(theta) 
Y(r,theta) = r * sin(theta)
Z(r,theta) = -r * r
my_cg = cgrad([:blue,:red,:yellow]);

thetas = range(0, stop=2*pi, length=50)
rs = range(0, stop=1, length=50)

xs = [X(r, theta) for theta in thetas, r in rs] 
ys = [Y(r, theta) for theta in thetas, r in rs]
zs = [Z(r, theta) for theta in thetas, r in rs]

surface!(xs, ys, zs,
label=false,xlims=(-1.5, 1.5), aspect_ratio=:auto,
xlabel="x", ylims=(-1.5,1.5), zlims=(-1.0, 0),c=my_cg)

```

 ![CleanShot 2021-02-06 at 16.20.05@2x](https://global.discourse-cdn.com/julialang/original/3X/f/6/f67eb062fef042db5f283cd4972ba7289058aa80.jpeg)

---

_[View the full topic](https://discourse.julialang.org/t/changing-the-z-scale-in-plots3d/54765)._
