Skip to content

geom_errorbar() issue when number of unique groups = number of labels #424

Closed
@royr2

Description

@royr2
library(plotly)
set.seed(123)

n = 10
random = rnorm(n)
df = data.frame(x = LETTERS[1:n],
                y = random,
                group1 = LETTERS[1:2],  # No of unique groups < no of labels on x-axis
                group2 = LETTERS[1:n],  # No of unique groups = no of labels on x-axis
                ymin = random + 0.1,
                ymax = random - 0.1)

# Works fine
ggplot(df, aes(x, y, ymin = ymin, ymax = ymax, color = group1)) + geom_point() + geom_errorbar()
ggplotly()

# gggplotly() shows +- NaNs for ymin and ymax
ggplot(df, aes(x, y, ymin = ymin, ymax = ymax, color = group2)) + geom_point() + geom_errorbar()
ggplotly()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions