Reputation: 2385
I want my corr-values to be positioned as close to the facet as possible. Now, some labels are positioned lower than other.
ggplot(df, aes(x, y)) +
geom_point(alpha=0.8) + stat_cor(method = "pearson",size=2.5) +
facet_wrap(~ miRNA + SYMBOL,ncol=4, scales="free") +
theme_bw(base_size = 8) +
geom_smooth(method = lm, fill = "lightgray")
Upvotes: 1
Views: 6514
Reputation: 17648
You can try label.*.npc
ggplot(mtcars, aes(cyl , disp)) +
geom_point(alpha=0.8) +
stat_cor(label.y.npc="top", label.x.npc = "left", method = "pearson",size=2.5) +
facet_wrap(~ vs ,scales="free") +
geom_smooth(method = lm, fill = "lightgray")
Upvotes: 4