3d plot plotly vs plotlyjs

So I have a 2 dimensional array I want to plot as a 3d surface in plotlyjs, the problem is that is not working on plotlyjs even though it works ok on plotly.

Here is an example:

using Plots
plotly()
A=reshape(repeat(sin.(collect(0:0.1:6)),6),61,6)
plot(A,linetype=:surface)

produces a pretty 3d surface:

While plotlyjs

using PlotlyJS
A=reshape(repeat(sin.(collect(0:0.1:6)),6),61,6)
plot(A,linetype=:surface)

produces a 6 simple lines that are overlapped:

How should I format my data or call the plot function to obtain the graph I’m getting with Plots.plotly() in PlotlyJS ???

I think you are confusing two things:

  • The Plots.jl package with the Plotly “backend”
  • The PlotlyJS.jl package.

These are two different packages, with different syntax. You need to use the right syntax for the right package.

Unfortunately it seems that they use the “same” function name to mean different things with regards to 3-dimensional data.

2 Likes