ggplotly not keeping different line types from geom_errorbar
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for a great package but I noticed one issue:
I have a ggplot which uses geom_errorbar() with a dashed line type. ggplotly removes this line type though. Is there a workaround?
Versions:
> packageVersion("plotly")
[1] ‘4.10.0’
> packageVersion("ggplot2")
[1] ‘3.3.5’
r version: 4.1.1
console: Mac
Issue replicated:
library(ggplot2)
df <- data.frame(
trt = factor(c(1, 1, 2, 2)),
resp = c(1, 5, 3, 4),
group = factor(c(1, 2, 1, 2)),
upper = c(1.1, 5.3, 3.3, 4.2),
lower = c(0.8, 4.6, 2.4, 3.6)
)
p <- ggplot(df, aes(trt, resp, colour = group))
q<- p + geom_errorbar(aes(ymin = lower, ymax = upper), width = 0.2,linetype="dashed")
q
plotly::ggplotly(q)
tagging others: @emiliecottard
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 supplied R reproduction using ggplot2::geom_errorbar() and plotly::ggplotly(), then inspect how the ggplotly conversion handles the geom_errorbar linetype aesthetic. Compare the rendered output with the original dashed error bars; the issue is done when dashed line types are preserved in the converted plot.
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
- Mostly clear
- Newbie friendliness
- 35/100