Skip to content

Map zoom not scaling evenly with facet wrap #2831

@nanophyto

Description

@nanophyto

Scaling of maps is not even when using facet_wrap.

plotly_map

Reproducible with the code below:

library(maps)
library(ggplot2)
library(plotly)

map <- map_data("world")
d <- as.data.frame(seq(1,25))
d$value <- sample(c(1:10), 25, replace=T)
d$lat <- sample(c(1:90), 25, replace=T)
d$lon <- sample(c(1:180), 25, replace=T)
d$season <- sample (c('Spring', 'Summer','Fall', 'Winter'), size=25, replace=T)

p <- ggplot() +
  geom_polygon(data=map, aes(x=long, y=lat, group=group), colour="grey", fill="light grey") +
  geom_point(data=d, aes(x=lon, y=lat,  size=value), alpha=I(0.7)) +
  facet_wrap( ~ season, ncol=2)

fig <- ggplotly(p)
fig

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions