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

plotting

#1

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:

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

On the contrary, in p2 (which is a 3d graph), the ‘xlims’ and ‘xlabel’ attributes don’t seem to work:
3d

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


#2

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


#3

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).

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

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.


#4

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

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


#5

Thank you very much, I opened the issue here