dkahle / dkahle/ggmap

Non square maps plot incorrectly using ggmap()

Open
#307 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

## Reproducible Example

```r
library(ggmap)
register_google(key = as.character(GoogleAPIkey))

#rectangle
map_1<-get_googlemap(center=c(-121.57,38.51), size=c(250, 500), zoom = 12, scale=2, maptype = "satellite", key=GoogleAPIkey )

ggmap(map_1)

```

![map1](https://user-images.githubusercontent.com/12225286/83162566-85b30d80-a0cf-11ea-9037-cd91e2d6f59f.png)

In the first example, the image appears twice and is compressed along the x-axis. It was downloaded using a rectangle `size=c(250,500)`. Also notice that the longitude axis labels appear as they should.

```r
#square
map_2<-get_googlemap(center=c(-121.57,38.51), size=c(500, 500), zoom = 12, scale=2, maptype = "satellite", key=GoogleAPIkey )

ggmap(map_2)

```

![map2](https://user-images.githubusercontent.com/12225286/83162586-8d72b200-a0cf-11ea-99a3-640677c93920.png)

In the second example, the image is downloaded as a square `size=c(500,500)`. It plots correctly.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue using the ggmap() and get_googlemap() examples with rectangular and square sizes. Trace how ggmap() handles the downloaded image dimensions; done when a non-square map renders once without x-axis compression and retains correct longitude labels.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.