# Axes attributes (labels, limits) not working in 3d plots

**URL:** <https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [April 14, 2018, 7:30pm UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341 "2018-04-14T19:30:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leoll2](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@leoll2](https://discourse.julialang.org/u/leoll2)\
**Post date:** [April 14, 2018, 7:30pm UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341/1 "2018-04-14T19:30:14Z")

</div>

I need to modify the labels and the range limits of the axes of my graph. It should be an easy task with Plots, indeed it is for 2d graphs. However, the same code doesn’t work when the dimensions become three (3d).  
I’m plotting in Juno, using Plots as library and plotlyjs as backend.  
Here’s my code:

```julia
using Plots

plotlyjs()

x = [2,3,4,1]
y = [8,3,1,2]
z = [4,5,3,4]

p1 = plot(x, y, seriestype=:scatter,
        title="Hello!", xlabel = "xlabel", ylabel="ylabel",
        xlims=(0.0, 6.5), ylims=(0.0,9.0))
p2 = plot(x, y, z, seriestype=:scatter,
        title="Hello!", ylabel="ylabel", zlabel="zlabel",
        xlims=(0.0, 12.5), ylims=(0.0,9.0), zlims=(0.0,5.0))

```

p1, which is a 2d graph, is displayed correctly:  
 ![2d](https://global.discourse-cdn.com/julialang/original/3X/2/a/2a17ce28597ff455c71f5b7b9d3f79bbd3be1a04.jpeg)

On the contrary, in p2 (which is a 3d graph), the ‘xlims’ and ‘xlabel’ attributes don’t seem to work:  
 ![3d](https://global.discourse-cdn.com/julialang/original/3X/9/0/90d8f931a3f4e7de5b3ae29ad49a58691c0de1c0.jpeg)

Is it a bug or I need to change something? In the latter case, where do I find useful (not outdated) documentation?  
Thanks!

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [April 15, 2018, 10:41am UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341/2 "2018-04-15T10:41:06Z")

</div>

This looks like a bug. Are you getting this for other backends as well?  
The documentation (btw) is at [docs.juliaplots.org](http://docs.juliaplots.org).

---

<div class="post-metadata">

**Author:** ![leoll2](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@leoll2](https://discourse.julialang.org/u/leoll2)\
**Post date:** [April 15, 2018, 12:33pm UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341/3 "2018-04-15T12:33:29Z")

</div>

I’ve also tried GR, it’s slightly better. The limits of the axes do work, the labels don’t.  
Here’s the code I used (similar to original post, just exaggerated the axes limits to prove that it works).

```julia
gr()
p2 = plot(x, y, z, seriestype=:scatter,
        title="Hello!", xlabel="xlabel",ylabel="ylabel", zlabel="zlabel",
        xlims=(0.0, 80.5), ylims=(0.0,9.0), zlims=(0.0,5.0))

```

And the output:  
 ![gr](https://global.discourse-cdn.com/julialang/original/2X/2/2b3fc068f7bab96197545efd83ee5f813096cee6.JPG)

As you can see, the xlabel is out of place (as if it was 2d, but it’s 3d!) and the zlabel doesn’t appear at all.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [April 15, 2018, 4:11pm UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341/4 "2018-04-15T16:11:47Z")

</div>

Thanks for trying it out. Someone opened an issue for the GR behaviour recently ([https://github.com/JuliaPlots/Plots.jl/issues/1483](https://github.com/JuliaPlots/Plots.jl/issues/1483)).

It’d be helpful if you’d open an issue on the plotlyjs behaviour.

---

<div class="post-metadata">

**Author:** ![leoll2](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@leoll2](https://discourse.julialang.org/u/leoll2)\
**Post date:** [April 15, 2018, 5:05pm UTC](https://discourse.julialang.org/t/axes-attributes-labels-limits-not-working-in-3d-plots/10341/5 "2018-04-15T17:05:20Z")

</div>

Thank you very much, I opened the issue [here](https://github.com/JuliaPlots/Plots.jl/issues/1485)
