ggplotly() to show geom_ribbon() with only upper and lower bounds strokes
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
In the latest ggplto2 release, geom_ribbon() can only stroke the upper and lower bounds and I'm wondering whether it is possible for the ggplot-converted plotly graphic to also have this feature?
A small code to play around with:
library(ggplot2)
library(plotly)
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
huron <- data.frame(year = 1875:1972, level = as.vector(LakeHuron))
p1 <- ggplot(huron, aes(year)) +
geom_ribbon(aes(ymin = level - 10, ymax = level + 10), fill = "grey", colour = "black")
p1

ggplotly(p1)

Created on 2022-02-18 by the reprex package (v2.0.1)
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 by running the supplied LakeHuron example with ggplot2 and ggplotly, then trace how geom_ribbon() is converted. Compare the source and converted plots, and verify that the resulting graphic preserves strokes on only the upper and lower bounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100