[英]R: How to control font size of legend map in plotly/ggplotly?
You can change the font size of the legend using legend.text
in your theme
like this:您可以在
theme
中使用legend.text
更改图例的字体大小,如下所示:
library(dplyr)
library(ggplot2)
library(plotly)
p <- iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
geom_point() +
theme(legend.text=element_text(size=3))
ggplotly(p)
p <- iris %>%
ggplot(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
geom_point() +
theme(legend.text=element_text(size=15))
ggplotly(p)
Created on 2022-07-15 by the reprex package (v2.0.1)由reprex 包于 2022-07-15 创建 (v2.0.1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.