# Makie: adjusting axis scale / limits in 3D

**URL:** <https://discourse.julialang.org/t/makie-adjusting-axis-scale-limits-in-3d/29231>\
**Category:** Visualization\
**Tags:** plotting, makie\
**Created:** [September 27, 2019, 12:45pm UTC](https://discourse.julialang.org/t/makie-adjusting-axis-scale-limits-in-3d/29231 "2019-09-27T12:45:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [February 7, 2021, 8:10pm UTC](https://discourse.julialang.org/t/makie-adjusting-axis-scale-limits-in-3d/29231/6 "2021-02-07T20:10:10Z")

</div>

Resurrecting this Makie thread as I cannot get the axes limits to work in 3D surface plots by using the keyword `limits` as indicated above. Running Julia Version 1.6.0-beta1.0 on Win10 VS Code.  
_PS: the following workaround sets NaNs outside the z-limits but the plot edges are not properly shaved… Is there any option to smooth the edges?_

```julia
using Makie
x = y = LinRange(-2, 2, 200)
f(x,y) = -(x^2 + y^2)
scene = Scene(resolution = (1000, 1000))
zlimf(x,y) = -2 < (z = f(x,y)) < -0.5 ? z : NaN # z-limiting function (workaround)
surface!(scene, x, y, zlimf)

```

 ![makie_surface_zlimits](https://global.discourse-cdn.com/julialang/original/3X/1/5/15f020402c2e11706552b4bc501fb0b5544e37b9.jpeg)

---

_[View the full topic](https://discourse.julialang.org/t/makie-adjusting-axis-scale-limits-in-3d/29231)._
