【问题标题】:Map created with geom_sf looks tilted使用 geom_sf 创建的地图看起来倾斜
【发布时间】:2021-10-10 15:50:07
【问题描述】:

我正在使用 geom_sf 来可视化一些位置。这是我的代码:

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")

地图是我正在寻找的,除了它看起来倾斜之外,我希望它与轴对齐。这可能吗?

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    你想旋转你的情节吗?

    检查这些功能:

    • coord_flip() - 创建水平图;
    • scale_x_reverse(), scale_y_reverse() - 反转轴。

    另外,这个问题对你很有用:ggplot2: How to rotate a graph in a specific angle?

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-22
      相关资源
      最近更新 更多