Ani
Ani

Reputation: 338

Removing the confidence interval on ggplot2 on plot

I have a plot and I am trying to remove the confidence interval(the gray cast on the smooth line)for each on my line but it's not working. I used the code below:

ggplot(data, aes(x=, y=)) + geom_smooth(aes(color="KHRC"),se = FALSE, span = 0.3)+
  geom_smooth(data=GO1,aes(color="GO1"))+
  geom_smooth(data=GO2,aes(color="GO2"))+
  geom_smooth(data=GO4,aes(color="GO4"))+
  geom_smooth(data=GO3,aes(color="GO3"))+
  geom_smooth(data=GO6,aes(color="GO6"))+
  scale_x_datetime(limits = c(ymd_hms("2016-11-05 09:00:00"), ymd_hms("2016-11-07 00:00:00")))+
  labs(color="ID")+
  ggtitle("x vs y ")

I need help with what code to use to remove the confidence interval.Also, I see no difference when I change the span, suggestions on that too will be great.Thank you for your help in advance.

Upvotes: 6

Views: 18388

Answers (1)

Ani
Ani

Reputation: 338

ggplot(data, aes(x=, y=)) + geom_smooth(aes(color="KHRC"),se = FALSE, span = 0.3)+
  geom_smooth(data=GO1,aes(color="GO1"),se = FALSE,span = 0.3)+
  geom_smooth(data=GO2,aes(color="GO2"),se = FALSE,span = 0.3)+
  geom_smooth(data=GO4,aes(color="GO4"),se = FALSE,span = 0.3)+
  geom_smooth(data=GO3,aes(color="GO3"),se = FALSE,span = 0.3)+
  geom_smooth(data=GO6,aes(color="GO6"),se = FALSE,span = 0.3)+
  scale_x_datetime(limits = c(ymd_hms("2016-11-05 09:00:00"), ymd_hms("2016-11-07 00:00:00")))+
  labs(color="ID")+
  ggtitle("x vs y ")

Upvotes: 6

Related Questions