-
Notifications
You must be signed in to change notification settings - Fork 633
ggplotly does not support negative values #874
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
Comments
I believe I found the same thing. I have a histogram with different values below and above the horizontal axis. This plots correctly without plotly, with one histogram downward from the horizontal axis and one above it, but with ggplotly it overlays the two histograms on top of each other, both above the axis. I don't know if it's helpful in determining cause, but the bars also appear to be stacked instead of overlayed. set.seed(15)
dd<-data.frame(x=rnorm(100,5,2))
set.seed(5)
dd2<-data.frame(x=rnorm(100,5,2))
p3 <- ggplot() + geom_histogram(data=dd,aes(x=x,y=..count..)) + geom_histogram(data=dd2,aes(x=x,y=-..count..),color='green')
p3
ggplotly(p3) |
I, too, have this issue. I think it is a duplicate of #560 |
This seems to be fixed now |
Hi there,
I have just found that ggplotly take absolution of values before plotting. In other words it seems it does not support negative values.
p <- ggplot(dft, aes(x=id, y=value, fill=value)) + geom_bar(stat="identity") +
geom_abline(intercept = x, slope = 0, color = "blue", size = .3) +
geom_text(aes(15,x,label = "Avg. value", vjust = -1))
plot(p)
ggplotly(p)
The text was updated successfully, but these errors were encountered: