У меня есть следующий код, создающий точечный график, и я хотел бы изменить положение легенды так, чтобы оно все еще находилось за пределами графика, но в центре или в середине, как я могу это сделать?
f <- list(
family = "Courier New, monospace",
size = 18,
color = "#7f7f7f"
)
x <- list(
title = "Age of Buildings",
titlefont = f,
zeroline = FALSE,
showline = FALSE,
showticklabels = TRUE,
showgrid = TRUE
)
y <- list(
title = "Total Violations",
titlefont = f,
zeroline = FALSE,
showline = FALSE,
showticklabels = TRUE,
showgrid = TRUE
)
fig2 <- plot_ly(final, x=~agebuilding, y=~violationstotal, mode= "markers", color = ~INdexrehabless6, size = ~totalvalue)
fig2 <- fig2 %>% layout(xaxis = x, yaxis = y, legend=list(title=list(text='<b> Housing Conditions </b>'))) #chaging name legend
fig2
Вот сюжет, который я получаю
![enter image description here](https://i.stack.imgur.com/NwORr.jpg)