Hello,

I drew a simple area plot using ggplot2 using

set <- read.table(file="http://www.jovian.nl/set.csv";, head=1,  sep=",")
library(ggplot2)
ggplot() + 
layer(
  data = set, mapping = aes(x = time, y = hours),
  geom = "area", stat="smooth", color="red"
) +
layer(
  data = set, mapping = aes(x = time, y = hours),
  geom = "area", color="red", fill="red", alpha="0.5"
) 

I have two questions about this visualisation:

- The smooth function is too "rough" right now, how do I make it follow the
original values more closely?
- The smooth function turns up with negative values (e.g. at the beginning):
How do I prevent this? (e.g. to use 0 instead of any negative value.)

Thanks,

Werner


--
View this message in context: 
http://r.789695.n4.nabble.com/questions-regarding-stat-smooth-in-ggplot-area-plot-tp3402632p3402632.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to