plotly / plotly/plotly.R

Alpha from stat_summary_2d ignored

Open
#1,428 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ggplotly
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:
image

plotly output:
screen shot 2018-12-06 at 12 10 54 pm

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.