Alpha from stat_summary_2d ignored
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
ggplotly does not carry over the alpha level for stat_summary_2d. Seems like it may be similar to the same issue that occurred with points in a previous version.
This isn't as obvious in the reproducible example, but for regions where the map isn't just water, and the locations are more dense, having the alpha allows for a visible basemap.
fiji <- get_googlemap("Fiji", zoom = 5, maptype = "roadmap", color = "bw", size = c(640, 480), scale = 2)
ggplotly({
ggmap(fiji, extent = "device") +
stat_summary_2d(data = quakes, aes(x = long, y = lat, z = mag), alpha = .55 , fun = mean, bins = 100) +
scale_fill_gradient(name = "Fullness", low = "green", high = "red")
}, tooltip = "fill"
)
ggplot2 output:

plotly output:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducible R example in the issue and compare the ggplot2 and plotly outputs, focusing on stat_summary_2d and its alpha setting. Trace the conversion path for this layer and verify the result by confirming that the plotly output preserves the requested transparency over the basemap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- plotly, r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100