Black Lives Matter. Please consider donating to Black Girls Code today.

Matlab Offline 3D Plots

I am trying to convert Matlab plots to plotly plots using the offline feature. For the most part it seems to be doing fine with the 2d plots that i have, but when i try a 3d plot I notice the axes lose their title and it looks like the graph is shrunk down. (maybe because the axis intervals?)

I also notice the coloring we have on the original Matlab plot does not match the Plotly plot.

Does anyone know why this may be happening?

Thanks for the help.


Here is a picture of the original matlab plot. I can get a better one if needed.

Thanks Again.

3D axis attributes have to be wrapped inside a scene container:

Thanks for the quick response.
Do i also have to adjust the color scale in the scene container? It looks like it changed the color scale based on the z axis instead of what it was originally using.

No. Colorscale settings are set in the trace container.


Thanks again.
I guess the colorscale is in the correct color, but it is using the Z-axis to determine the color instead or the original matrix provided in the matlab code. Do you know how to set these values or why plotly defaulted to use the Z axis.
(In the matlab picture i provided, you can see that the color doesnt progress up the color scale as you move up the Z-axis)

Sorry, Been looking for awhile but there isn’t a lot of documentation when using 3d Surface plots.

Ah my mistake.

You can map arbitrary 2D data to each coordinates on your surface using surfacecolor.