[英]R: How to control font size of legend map in plotly/ggplotly?
您可以在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)
由reprex 包於 2022-07-15 創建 (v2.0.1)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.