![](/img/trans.png)
[英]ggplot2: Plot coefficients in coefficient plot using facet_grid
[英]R plot using ggplot facet_grid add legend
使用ggplot
和faced_grid
,我無法可視化type1變量的整個名稱。 名稱太長。 如何添加圖例以避免此問題?
DF <- data.frame("value" = runif(50, 0, 1),
"type1" = c(rep("AAAAAAAAAAAAAAAAAAAAAA", 25),
rep("BBBBBBBBBBBBBBBBB", 25)),
"type2" = rep(c("c", "d"), 25),
"number" = rep(2:6, 10))
ggplot(DF, aes(y = value, x = type1)) +
geom_boxplot(alpha = .3) +
ggtitle("TITLE") +
facet_grid(type2 ~ number)
結果如下:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.