Ask Your Question

Revision history [back]

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.