Строка может быть изменена аргументом showline = T
или в некоторых случаях с помощью
zeroline = T
в зависимости от того, работает ли ваш график в диапазоне 0-x.
почти все атрибуты можно посмотреть здесь
p <- plot_ly(mtcars, x = ~mpg, y = ~cyl, type = 'bar', orientation = 'h',
marker = list(color = viridis::viridis_pal(option = "C", direction =1)(max(mtcars$mpg) - min(mtcars$mpg) + 5))) %>%
config(displayModeBar = F)
p <- layout(p, title = 'A plot',
autosize = TRUE,
margin = list(l = 50, r = 0, b = 20, t = 60, pad = 2),
xaxis = list(title = 'horizontal', ticks = "outside", ticklen = 5, tickwidth = 2, tickcolor = toRGB("black"),
showgrid = T, autorange = T, showticklabels = TRUE, zeroline = F, showline = T),
yaxis = list(title = 'vertical', ticks = "outside", ticklen = 5, tickwidth = 2, tickcolor = toRGB("black"),
showgrid = T, autorange = T, showticklabels = TRUE, zeroline = F, showline = T),
showlegend = T, #show it or not
legend = list(x = 100, y = 0.5), # can be used to position the legend
scene = list(aspectratio = list(x = 1, y = 1, z = 1))) # can be used to keep the plot square, or not
p