Usually I have difficulties to understand how `loess` interpolation works, in particular the definition of intervals. Often I am not able to understand why they do not appear.
As far as I know it is needed at least 5 data points but in some case even with more than 5 I am not able to see them.

I report below the last example I have:

``````# Dataframe 1 creation
temperatura <- c(120, 130, 140, 150, 160, 120, 130, 140, 150, 160)
viscosita <- c(65000, 45000, 29500, 20500, 15500, 65000, 45000, 29500, 20500, 15500)
df <- data.frame(Temperatura = temperatura, Viscosita = viscosita)

library(ggplot2)

Graph1 <- ggplot(data=df, aes(x=`Temperatura`, y=`Viscosita`)) +
geom_point(aes(color = "red"), shape = 1, size = 3.0, stroke = 1.5) +
geom_smooth(aes(level=0.99, span = 0.1))

Graph1
``````

But if I change slightly one point, I get them:

``````# Dataframe 2 creation
temperatura <- c(120, 130, 140, 150, 160, 120, 130, 140, 150, 160)
viscosita <- c(65000, 45000, 29500, 20500, 15500, 65000, 43500, 29500, 20500, 15500)
df <- data.frame(Temperatura = temperatura, Viscosita = viscosita)

library(ggplot2)

Graph2 <- ggplot(data=df, aes(x=`Temperatura`, y=`Viscosita`)) +
geom_point(aes(color = "red"), shape = 1, size = 3.0, stroke = 1.5) +
geom_smooth(aes(level=0.99, span = 0.1))

Graph2
``````

I would like better to understand how it works.
I have tried to change parameters n (number of window-points where it make the loess calculation), level (% of confidence interval), span, but I was not able to get the bands on `Graph1`.