问题
Is there a way to change the legend size in plotly for R? I have not come across this option. I have looked at the docs on legends, https://plot.ly/r/legend/, but it does not mention this.
回答1:
Use layout(legend = list(font = list(size(30)))):
plot_ly(data = mtcars, x = as.character(mtcars$cyl),
y = mtcars$mpg, type = "box", color = as.character(mtcars$cyl)) %>%
layout(showlegend = TRUE, legend = list(font = list(size = 30)))
来源:https://stackoverflow.com/questions/37245004/change-legend-size-in-plotly-chart