plotly / plotly/plotly.R

Map zoom not scaling evenly with facet wrap #2831

Open
#1,861 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reproducible R example with maps, ggplot2, and plotly, focusing on the facet_wrap map output. Trace how faceted map scales are generated and verify the change by confirming that all facet panels scale evenly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.