更改绘图图表中的图例大小 [英] Change legend size in plotly chart

查看:24
本文介绍了更改绘图图表中的图例大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法改变 R 的图例大小?我没有遇到过这个选项.我查看了有关图例的文档,https://plot.ly/r/legend/,但它没有提到这一点.

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.

推荐答案

使用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)))

这篇关于更改绘图图表中的图例大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆