Search code examples
rplotlyheatmap

R Plotly - change names of axis in heatmap


I don't know how to change names of axis in my heatmap. This is my example code:

 p <- plot_ly(x = XXX, y =  YYY, z = ZZZ, type = "heatmap")
 p

And I wont to my axis different names.


Solution

  • Here is an example (you did not provide a reproducible example) that will give you x/y labels and a title

    x <- list(
        title = "x Axis"
    )
    y <- list(
        title = "y Axis"
    )
    plot_ly(z = volcano, colorscale = "Hot", type = "heatmap") %>% layout(title = "Hello", xaxis = x, yaxis = y)