[英]How to plot many graphs with ggplot
我想從 51 個圖形中繪制一個圖。 而且我想將圖表分成 3 列和 17 行,所以我會得到大小合適的圖表。 以下代碼的結果垂直壓縮了圖形。 如果有人能幫助解決這個問題,我將不勝感激。
p<-ggplot(results, aes(x=lidar, y=zval, col=meas)) +
geom_violin(aes(x=lidar, y=zval, group=lidar, fill=lidar), inherit.aes = FALSE)+ guides(fill=FALSE)+
scale_fill_manual(values=c("lightblue", "lightgreen"))+
geom_jitter(aes(alpha=signif, shape=meas), size=3, color="black") +
scale_shape_manual(values=1:nlevels(as.factor(results$meas))) +
facet_wrap(~species, ncol=3, drop = FALSE) + geom_abline(intercept = 1.96, slope = 0, col="orange")+
theme(strip.text.x = element_text(size = 13, margin = margin()), axis.title = element_text(size=35,face="bold"),
axis.text=element_text(size=25), legend.text = element_text(size=25), legend.title = element_text(size=25))+
labs(y = "Z value", x="Sensors", shape="Metrics")+guides(alpha=FALSE)
以下將刪除沿 Y 軸 (0,2,4,6) 的狹窄文本。
+theme(axis.text.y = element_blank())
我相信圖表仍然有意義
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.