plotly / plotly.R

An interactive graphing library for R
https://plotly-r.com
Other
2.53k stars 623 forks source link

add_ribbons can't handle NA values #1884

Open LTribelhorn opened 3 years ago

LTribelhorn commented 3 years ago

The plotly function add_ribbons() doesn't function properly when cases in the middle or at the end have NA values. These lead to a weird behaviour where parts of the ribbons are missing or drawn in wrong places (see Plots 1 & 3). When the connectgaps-Attribute is set to TRUE for the ribbon the bug doesn't appear (see Plot 2). NA values in the beginning don't seem to be a problem as well (see Plot 3, Red Trace 2).

The same behaviour has also been reported with ggplot and plotly in issue #1060. But because it may either be two separate problems or just a problem in plotly itself also affecting the ggplot visualization I decided to open this separate issue.

lucalamoni commented 1 month ago

Hello, I have the same problem described above. When the time series has some NAs in the middle the ggplotly function does not display the data correctly. Do you know if this issue has been addressed already? Thank you