I have a really long and extended code, which I have created with graphs that shows lines overlapping.
Could you please suggest something to disentangle this and make the reproduction clearer? Maybe some other options to modify the size of graph itself?
For example when save graphs with ggsave
.
Thanks
REPREX
Here the datset I am working on
df = structure(list(ANT = c("MEDIUM", "MEDIUM", "MEDIUM", "LOW", "LOW",
"LOW", "HIGH", "HIGH", "HIGH"), BUT = c("flat", "tighted", "curved",
"flat", "tighted", "curved", "flat", "tighted", "curved"), var = c("sighted",
"sighted", "sighted", "sighted", "sighted", "sighted", "sighted",
"sighted", "sighted"), mean = c(24.9795700007983, 22.5476640156841,
24.4568444611505, 24.4608952261011, 22.179843452558, 25.1211893108135,
24.1807279709165, 21.9700173259632, 25.5690587972475), low = c(24.1929993862564,
22.0173613402898, 23.7793134256169, 23.5748441551253, 21.2709153846706,
24.2111126105412, 23.376952383782, 21.3272260871708, 24.7053231240633
), up = c(25.7661406153403, 23.0779666910784, 25.1343754966842,
25.3469462970768, 23.0887715204454, 26.0312660110858, 24.984503558051,
22.6128085647556, 26.4327944704316)), row.names = c(NA, -9L), class = c("tbl_df",
"tbl", "data.frame"))
the table where to get the statistics label from
val = structure(list(group1 = c("flat", "flat", "tighted", "flat",
"flat", "tighted", "flat", "flat", "tighted"), group2 = c("tighted",
"curved", "curved", "tighted", "curved", "curved", "tighted",
"curved", "curved"), y.position = c(45.985, 48.4375, 50.89, 53.985,
56.4375, 58.89, 58.493, 60.9455, 63.398), lab = c("0.0132 - *",
"0.585 - ns", "0.0494 - ns", "0.0826 - ns", "0.618 - ns",
"0.0214 - ns", "0.0458 - ns", "0.211 - ns", "0.00171 - **"
)), row.names = c(NA, -9L), class = c("tbl_df", "tbl", "data.frame"
))
and the code that I have used
library(ggplot2)
library(ggpubr)
ggplot(df,
aes(x= BUT, y= mean,
colour= ANT, group = ANT)) +
geom_errorbar(aes(ymin= low,
ymax= up),
colour="black", width=.10) +
geom_line() +
geom_point(size= 3, shape= 21, fill="white") +
stat_pvalue_manual(
val,
step.increase=0.05,label = "lab")