Skip to content

ggplotly discrete x axis with error bar  #1589

Open
@dingying85

Description

@dingying85

Hi ggplotly developer,

I am wondering in the following example. I would like the points to be connected similar as ggplot2, but after ggplotly renderig, they are not connected.

Any advice of how to make them connected? Thanks.

library(plotly)

population <- data.frame(Year=seq(1790, 1970, length.out=length(uspop)), 
                         Population=uspop, 
                         Error=rnorm(length(uspop), 5))

library(ggplot2)
p <- ggplot(population, aes(x=Year, y=Population, 
                       ymin=Population-Error, ymax=Population+Error))+
  geom_line()+
  geom_point(pch=2)+
  geom_errorbar(width=0.9)

p <- ggplotly(p)
p

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions