Reputation: 1247
I have the following code
library(plotly)
A <- matrix(seq(1, 20), nrow = 4, ncol = 5)
p <- plot_ly(z = t(A), type = "heatmap", colorscale = "Greys")
p
Is there anyway to change to steps between the ticks on the y-axis to display only the even numbers (0, 2, 4)?
Upvotes: 0
Views: 180
Reputation: 1730
You need to specify some of the layout.yaxis.tick*
attributes. You can read more about it here to see further customisation options.
library(plotly)
A <- matrix(seq(1, 20), nrow = 4, ncol = 5)
p <- plot_ly(z = t(A), type = "heatmap", colorscale = "Greys")
p %>% layout(
yaxis = list(
tickmode = 'array',
tickvals = seq(0, 5, by = 2),
ticktext = seq(0, 5, by = 2)
)
)
Upvotes: 1