You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The se fill when variable factor(gear) is equal to 5 is dropped from the plot, but still appears in the legend. I think it should be dropped from the legend too.
``` r
library(reprex)
library(ggplot2)
#> Registered S3 methods overwritten by 'ggplot2':
#> method from
#> [.quosures rlang
#> c.quosures rlang
#> print.quosures rlang
ggplot(data = mtcars, aes(x = mpg, y = disp)) +
geom_smooth(aes(fill = factor(gear)))
#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : span too small. fewer data values than degrees of freedom.
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : pseudoinverse used at 14.923
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : neighborhood radius 4.777
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : reciprocal condition number 0
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : There are other near singularities as well. 116.14
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : Chernobyl! trL>n 5
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : Chernobyl! trL>n 5
#> Warning in sqrt(sum.squares/one.delta): NaNs produced
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : span too small.
#> fewer data values than degrees of freedom.
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
#> at 14.923
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
#> 4.777
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : reciprocal
#> condition number 0
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : There are other
#> near singularities as well. 116.14
#> Warning in stats::qt(level/2 + 0.5, pred$df): NaNs produced
```

<sup>Created on 2019-06-14 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>
The text was updated successfully, but these errors were encountered:
The legend does not use the layer data, only the scales and the draw_key from the geometry. I think that changing the code to enable this would probably be a lot of work.
I think discussion about smarter guide/layer interactions should be continued in #3648.
However, geom_smooth() doesn't drop that fill level at all. It just sets the ymin/ymax aesthetics to NA because the standard error couldn't be calculated. So even if we would get guides to be smarter, it is still unlikely that this case can be detected. I don't think it is currently worth it to special-case such situation.
Uh oh!
There was an error while loading. Please reload this page.
The
se
fill when variablefactor(gear)
is equal to5
is dropped from the plot, but still appears in the legend. I think it should be dropped from the legend too.The text was updated successfully, but these errors were encountered: