Cannot add labels to x-y-z axis in 3D surface plot


I have trouble adding x-y-z labels to x,y,z axis in 3D surface plot using Julia PlotlyJS. I was following Setting the font, title, legend entries, and axis titles in Julia, but it does not work.

Could I have any help from you on adding labels to axis in a surface plot? Attached is an MWE.

using Random
using PlotlyJS

#estimates for theta(f, p,s) are: [0.001129871928323615, 0.03526205536504482, 0.021740788808604708]
f_vec = LinRange(0,0.015,30)
p_vec = LinRange(0,0.3,30)

## Plot over f and p  
ll_sum_matr= rand(Float64, (30, 30))

layout = Layout(
    title="ll_sum over f and p(x:f,y:p_vec)", 
    width=500, height=500,
    margin=attr(l=65, r=50, b=65, t=90)
### ll_sum over f and p
plot(surface(z=ll_sum_matr, x=f_vec, y=p_vec), layout)

I have to plot in the way above, use the function to generate z values first and plot them over (x,y). I could not use “plot(f,x,y)” which takes very long to run, since the function I will use is very slow.

Thank you in advance!

Hi @jfan,

I’m sorry for this late reply. Unfortunately, someone has merged (why!!! :frowning: ) the separate sections for Julia, Matplab, R, into a common one, and it’s hard to notice when a question is asked for a particular Plotly version.

A surface is a 3D plot and in this case the axis attributes are set for scene_xaxis, scene_yaxis, scene_zaxis.
In your case enter the following lines in the Layout definition: