pampicloud / cma-week1

Solving Exercise 2
0 stars 0 forks source link

geom_path and coord_fixed #6

Open ratnanil opened 3 years ago

ratnanil commented 3 years ago

https://github.com/pampicloud/cma-week1/blob/def2cf6735745bf0b540d558590c630858781f2f/assignment/assignment_2.Rmd#L195-L198

You need to use geom_path() instead of geom_line, since the latter joins points from left to right (west to east) instead of choronologially.

In addition, you need to make sure the coordinates are equal with coord_fixed()

ggplot(NULL, aes(E, N)) +    
  geom_path(data = caro, col = "red") + 
  geom_point(data = caro, col = "red") +
  geom_path(data = caro_3, col = "blue") + 
  geom_point(data = caro_3, col = "blue") +
  coord_fixed()