[英]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.