Sorry it took me a bit to write back, but this is the data and the code of the plot I would like to do:
my_dput <- structure(list(DPF = c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5), median_proportion_positive = c(0.224,
0.22, 0.216, 0.212, 0.208, 0.205, 0.201, 0.198, 0.195, 0.191,
0.188, 0.185, 0.182, 0.179, 0.176, 0.173, 0.17, 0.167, 0.164,
0.162, 0.159, 0.156, 0.154, 0.151, 0.148, 0.146, 0.143, 0.141,
0.139, 0.136, 0.134, 0.132, 0.13, 0.127, 0.125, 0.123, 0.121,
0.119, 0.117, 0.115, 0.113, 0.111, 0.109, 0.108, 0.106, 0.104,
0.102, 0.101, 0.0988, 0.0971), Per2.5_proportion_positive = c(0.189,
0.187, 0.184, 0.182, 0.179, 0.176, 0.173, 0.17, 0.167, 0.164,
0.16, 0.157, 0.154, 0.15, 0.147, 0.143, 0.14, 0.137, 0.133, 0.13,
0.127, 0.123, 0.12, 0.117, 0.114, 0.111, 0.108, 0.105, 0.102,
0.0995, 0.0968, 0.0942, 0.0917, 0.0893, 0.0868, 0.0844, 0.082,
0.0798, 0.0776, 0.0755, 0.0735, 0.0715, 0.0695, 0.0676, 0.0658,
0.064, 0.0623, 0.0606, 0.0589, 0.0572), Per97.5_proportion_positive = c(0.261,
0.256, 0.251, 0.246, 0.241, 0.237, 0.233, 0.229, 0.225, 0.222,
0.219, 0.215, 0.213, 0.21, 0.207, 0.204, 0.202, 0.2, 0.197, 0.195,
0.193, 0.191, 0.189, 0.187, 0.186, 0.184, 0.182, 0.18, 0.178,
0.177, 0.175, 0.174, 0.172, 0.171, 0.169, 0.168, 0.166, 0.165,
0.163, 0.162, 0.161, 0.159, 0.158, 0.157, 0.156, 0.154, 0.153,
0.152, 0.15, 0.149)), row.names = c(NA, 50L), class = "data.frame")
If you call that data:
my_dput
This is the plot I want to make, but without the step (although as you suggested previously I have repeated values for DPF variable). Maybe a way around it is to give each of those decimal points to the integers...?
ggplot()+
geom_ribbon(data =my_dput,
aes(x= DPF,
ymin=Per2.5_proportion_positive,
ymax=Per97.5_proportion_positive),
fill = "#00798c", alpha = 0.5) +
geom_line(data = my_dput,
aes(x = DPF, y = median_proportion_positive),
size = 0.5 )