Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotly cannot handle Inf or -Inf when plotting #2364

Open
MLopez-Ibanez opened this issue Jun 19, 2024 · 0 comments
Open

plotly cannot handle Inf or -Inf when plotting #2364

MLopez-Ibanez opened this issue Jun 19, 2024 · 0 comments

Comments

@MLopez-Ibanez
Copy link
Contributor

plotly does not seem to know what to do with values that are Inf or -Inf. The expected behavior (as done by ggplot2) is to map those values to the maximum and minimum values representable in the type when plotting but to not include them in calculations related to ranges, zooming, axis labels, grid lines, etc.

library(dplyr)
library(ggplot2)
# as expected, this extends the line up to limits of the plot
p <- data.frame(x=c(1,1,Inf), y = c(Inf, 1, 1)) %>% ggplot(aes(x=x,y=y)) + geom_line()
p
library(plotly)
# This doesn't plot anything
ggplotly(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant