Ask Your Question
3

What are the issues when trying to use both geom_sf() and geom_point() in the same plot, resulting in the absence of points?

asked 2023-07-15 12:17:35 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-07-15 12:34:01 +0000

huitzilopochtli gravatar image

There could be a few reasons why points are not showing up when using both geom_sf() and geom_point() in the same plot:

  1. Mapping: Make sure that the aesthetics for both geoms are correctly mapped. If the mapping for geom_point() is incorrectly specified, the points may not show up.

  2. Data format: If the data format for geom_point() is different from geom_sf(), they may not be compatible. For example, if the spatial object in geom_sf() is in a different projection than the points in geom_point(), they may not be visible.

  3. Plot order: Check that the points are not being plotted underneath the polygons from geom_sf(). By default, geom_sf() will add the polygons first, which can hide any points plotted underneath.

  4. Zoom level: It is possible that the points are simply too small to see at the zoom level you are viewing the plot. Try adjusting the scale or size of the points to make them more visible.

  5. Layering: It is also possible that the points are being plotted but are simply not visible due to being overshadowed by the polygons. Try adjusting the layer order to make the points more prominent.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-15 12:17:35 +0000

Seen: 8 times

Last updated: Jul 15 '23