plotly / plotly/plotly.R

geom_errorbar - error bars displaying incorrectly (horizontal)

Open
#710 1 comment 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

geom_errorbar - error bars are displayed incorrectly (wrong size) on the horizontal display (does not happen for the vertical (non coord_flip() version)

Sample to reproduce:

dd2 <- data.frame( auc=c(0.268707482993197,0.571428571428571), 
                   high=c(0.407680628614317,0.648343533190079), 
                   low=c(0.129734337372078,0.494513609667063), 
                   Names = c("Firmicutes","Spirochaetes"))


library(ggplot2)
library(plotly)

gx <- ggplot(data=dd2, aes(y=auc, x=Names))  + 
  geom_bar(stat="identity") +   
  geom_errorbar(aes(ymax = high, ymin=low)) +
  coord_flip()
gx

gp <- ggplotly(gx)
gp   # error bars are incorrect size

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 by running the supplied R example with ggplot2, coord_flip(), geom_errorbar(), and ggplotly(), then compare the horizontal result with the vertical version. Trace how the reproduced plot is converted and verify that horizontal error bars preserve the intended low-to-high size and position.

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.