-
Notifications
You must be signed in to change notification settings - Fork 2.1k
geom_area with missing data issue #2720
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
As noted in the thread to which you referred, the problem here is one of automatic interpolation — obviously this isn't the desired behaviour, but the area chart is, in effect, treating your x-axis as continuous. |
library(ggplot2)
dat <- data.frame(
g=rep(LETTERS[1:3], each=4),
x=rep(1:4, 3),
y=rep(3:14))
dat[dat$g == "B" & dat$x == 3, ]$y <- 0
ggplot(dat, aes(x=x, y=y, fill=g)) + geom_area(stat = "identity") Created on 2018-06-29 by the reprex package (v0.2.0). |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Hey,
I think I found an issue with geom_area. I think it relates to this issue ##280, although the problem looks like it might be different to the previous problem. Have used the same dataframe as from issue above.
You can see that although the bar plot shows nothing for g = B at point x = 3, the area plot seems to make it look like it's actually g = A that is missing data. See chart and code below.
The text was updated successfully, but these errors were encountered: