Skip to content

Check if smooth should hide confidence band for low number of points #760

Description

@jkrumbiegel

Seems like ggplot2 doesn't draw the CI band for 6 points or less:

library(ggplot2)

df <- data.frame(
  time = c(0.0, 1.0, 2.0, 3.0, 4.0, 5.0),
  cp = c(1.0, 2.0, 1.5, 1.3, 1.1, 0.9)
)

ggplot(df, aes(time, cp)) +
  geom_smooth(se = TRUE) +
  geom_point()
Image

but

library(ggplot2)

df <- data.frame(
  time = c(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0),
  cp = c(1.0, 2.0, 1.5, 1.3, 1.1, 0.9, 0.4)
)

ggplot(df, aes(time, cp)) +
  geom_smooth(se = TRUE) +
  geom_point()
Image

I've also noticed the wavy pattern to be a bit unstable between local tests and some CI runner, so it should be investigated if it would be better to hide it.

In AoG the equivalent plots look like this

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions