yuw444
yuw444

Reputation: 426

plotly 3D surface, rename axis's title

Below is the toy example I have attempted. Is anything wrong with it?

library(plotly)
fig <- plot_ly(z = ~volcano)
fig <- fig %>% add_surface() %>%
  layout(
    xaxis = list(title = 'N'), 
    yaxis = list(title = 'R')
  )

fig

Thanks for your time.

Upvotes: 2

Views: 462

Answers (1)

Ben
Ben

Reputation: 30474

Try adding scene in layout:

library(plotly)

fig <- plot_ly(z = ~volcano)
fig <- fig %>% 
  add_surface() %>%
  layout(
    showlegend = F,
    scene = list(
      xaxis = list(title = 'N'), 
      yaxis = list(title = 'R')
    )
  )

fig

plotly 3d with axis labels

Upvotes: 2

Related Questions