plotly/plotly.R

Surface plot interprets dims 1 and 2 of a matrix to be y and x (should be reversed)

fang-zhaoyuan opened this issue · 0 comments

For example:

plot_ly(z = ~volcano, type = "surface")

Obviously, the 1st dimension of matrix volcano is interpreted as the 'y', while the 2nd dimension as the 'x'.

However, a more natural order is: 1st dimension of matrix to be 'x', while the 2nd dimension to be 'y'. Such interpretation is in other R packages such as MASS: the function kde2d() will returns x, y and z matrix, where the dim1 and 2 of z is x and y respectively.