plotly / plotly/plotly.R

ggplotly doesn't handle group aesthetic of geom_ribbon

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

Nobody has claimed this yet.

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

Description

When using geom_ribbon with only the group aesthetic, ggplotly seems to simply merge everything. Semitransparent ribbons, which should appear darker in the overlap region, are therefore indistinguishable.

reprex:

x <- 1:10
ymin1 <- x - 1
ymax1 <- x + 1
ymin2 <- x
ymax2 <- x + 2
p <- ggplot(data.frame(group=rep(c(1,2), each=10), x=rep(x, 2), ymin=c(ymin1, ymin2), ymax=c(ymax1, ymax2)), aes(x=x, group=group)) +
    geom_ribbon(aes(ymin=ymin, ymax=ymax), alpha=0.5)
p


Created on 2018-09-20 by the reprex package (v0.2.1.9000)

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 supplied R reprex and compare the ggplot2 result with the ggplotly result for geom_ribbon using only the group aesthetic. Trace the ggplotly entry point and determine why the two ribbons are merged; done means the semitransparent overlap is visibly darker as in the static plot.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.