Here is a screenshot of a graph made in another software that creates a scatter plot on top of a line graph, with the line hidden where the scatter plot is. This is what I am going for in R.
When I run the following code on my graph and data:
dput(my_df)
structure(list(lastFinancingYear = c(2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018), raiseMedVal = c(5.33287671232877,
5.03424657534247, 4.96986301369863, 7.36986301369863, 6.44383561643836,
7.73835616438356, 8.4958904109589, 9.9054794520548, 9.43013698630137
), foundMedVal = c(11.0821917808219, 10.5178082191781, 8.62191780821918,
10.2520547945205, 10.9643835616438, 10.9342465753425, 12.9945205479452,
13.5397260273973, 12.6301369863014)), row.names = c(NA, -9L), class = c("tbl_df",
"tbl", "data.frame"))
my_df %>% ggplot() +
geom_line(aes(x = lastFinancingYear, y = raiseMedVal), size = 1.0, color = "#DDBB7B") +
geom_point(aes(x = lastFinancingYear, y = raiseMedVal), shape = 1, size = 3.0, color = "#DDBB7B") +
geom_line(aes(x = lastFinancingYear, y = foundMedVal), size = 1.0)
... then i get a graph that looks like this:
Where the scatter markers are present and on top of the line, but the line is not hidden behind the marker, and also the scatter markers do not have a bold/thick enough marker. I am not sure how to fix these, and any help is appreciated!
Thanks in advance!



