plot(scatter(x = x, y = y), Layout( xaxis_range=[0.75, 5.25]))
I am not super familiar with PlotlyJS as I tend to use it through Plots, but they separate the plotlevel attributes from the serieslevel attributes by putting the plotlevel attributes in a Layout object.
This solution works for my first example, in 2D, but when I try examples where I plot in 3D it’s not working. For example:
N = 32
u = linspace(0, 2π, N)
v = linspace(0, π, N)
x = cos(u) * sin(v)'
y = sin(u) * sin(v)'
z = repeat(cos(v)',outer=[N, 1])
using PlotlyJS
PlotlyJS.plot(PlotlyJS.surface(x=x,y=y,z=z),Layout(xaxis_range=[0,5]))
How come this doesn’t change the x-limits? How can I do instead?
I finally found the solution. Apparently you have to add scene_xaxis_range=[0,5] instead of just xaxis_range=[0,5] when using 3D plots. I don’t know why it differs but at least it works!