# How to set axis limits in 3D plots

**URL:** <https://discourse.julialang.org/t/how-to-set-axis-limits-in-3d-plots/94813>\
**Category:** Visualization\
**Tags:** question, plotting, makie\
**Created:** [February 17, 2023, 11:21pm UTC](https://discourse.julialang.org/t/how-to-set-axis-limits-in-3d-plots/94813 "2023-02-17T23:21:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![math\_opt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math_opt/32/25317_2.png) [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Post date:** [February 17, 2023, 11:21pm UTC](https://discourse.julialang.org/t/how-to-set-axis-limits-in-3d-plots/94813/1 "2023-02-17T23:21:40Z")

</div>

For the code below, how do I set the axis limits to be same for all axes:

```julia
using CairoMakie
temp = [15 21 18 17; 15 12 11 18; 20 20 20 22]
fig, axis, plot = scatter(temp[1,:], temp[2,:], temp[3,:])
xlabel!(axis.scene, "data-1")
ylabel!(axis.scene, "data-2")
zlabel!(axis.scene, "data-3")

```

I need all axis limits to be between 0 and 35. I tried `xlims!(0,35)` , and so on but it doesn’t seem to work. Because the data in the z-dimension varies just between 20 and 22, the plot looks flat, which is not what I want. Any help in this regard is appreciated. Thanks!!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [February 18, 2023, 5:45am UTC](https://discourse.julialang.org/t/how-to-set-axis-limits-in-3d-plots/94813/2 "2023-02-18T05:45:45Z")

</div>

I would try Axis3 if you want to scale each dimension independently. You can get it and set manual limits via `axis = (; type = Axis3, limits = (...` passed to the plotting function
