1

I am using geom_sf to visualize some locations. This is my code:

ggplot(data = PR)+
  geom_sf(fill = "lightgray", 
          col = "black", 
          show.legend = F)+
  scale_fill_identity()+ 
  theme(panel.grid.major = element_line(color = "gray", 
                                        linetype = "dashed", 
                                        size = 0.5), 
        panel.background = element_rect(fill = "aliceblue"))+
  annotation_raster(img, 
                    ymin = 18.35, 
                    ymax = 18.5, 
                    xmin = -67.8, 
                    xmax =  -66)+
  geom_star(eulophia_transformed_with_lat_lon, mapping = aes(X,Y), 
            col = "black", fill = "red", 
            shape = 1, size = 2.5)+
  coord_sf(crs = "ESRI:102003")

The map is what I am looking for, except that it looks tilted, I want it to be aligned with the axes. Is that possible?

Normandie
  • 11
  • 1

1 Answers1

0

Do you want to rotate your plot?

Check these functions:

  • coord_flip() - to create horizontal plots;
  • scale_x_reverse(), scale_y_reverse() - to reverse the axes.

Also, this question will be useful for you: ggplot2: How to rotate a graph in a specific angle?

Good luck!

manro
  • 3,529
  • 2
  • 9
  • 22