Skip to content

sf graticule axis ticks overlap #1673

Description

@cpsievert
library(rnaturalearth)
library(sf)
library(dplyr)
world <- ne_countries(returnclass = "sf")

# filter the world sf object down to canada
canada <- filter(world, name == "Canada")
# coerce cities lat/long data to an official sf object
cities <- st_as_sf(
  maps::canada.cities,
  coords = c("long", "lat"),
  crs = 4326
)
# A PROJ4 projection designed for Canada
# http://spatialreference.org/ref/sr-org/7/
# http://spatialreference.org/ref/sr-org/7/proj4/
moll_proj <- "+proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84
+units=m +no_defs"
# perform the projections
canada <- st_transform(canada, moll_proj)
cities <- st_transform(cities, moll_proj)
# plot with geom_sf()
p <- ggplot() +
  geom_sf(data = canada) +
  geom_sf(data = cities, aes(size = pop), color = "red", alpha = 0.3)
ggplotly(p)

Screen Shot 2019-12-26 at 11 29 57 AM

Activity

  1. added a commit that references this issue on Dec 26, 2019
    c037c68
  2. added a commit that references this issue on Mar 12, 2020
    32dde41
  3. added a commit that references this issue on Jun 26, 2022
    504c33f
  4. added a commit that references this issue on Jul 4, 2022
    55f49ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions