> On Aug 11, 2019, at 9:13 AM, Troels Ring wrote:
>
> Dear friends - I have 2 problems with ggplot2
>
> Here is the code for illustration
>
>
>
> x <- seq(1,10,length=1)
>
> y <- x^2
>
> fill <- rep(0,length(x))
>
> fill[(5
> ddf <- data.frame(x,y,fill)
>
> ggplot(data=ddf,aes(x=x
Hello,
You must put the NA in scale_fill_manual. Like this:
ggplot(data = ddf, aes(x = x, y = y)) +
geom_area(aes(fill = fill)) +
geom_line() +
scale_fill_manual(values = c(NA, "red"))
Note also that 'fill' is a factor, were it numeric you would need fill =
factor(fill).
ddf2 <- data
Dear friends - I have 2 problems with ggplot2
Here is the code for illustration
x <- seq(1,10,length=1)
y <- x^2
fill <- rep(0,length(x))
fill[(5https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide comment
3 matches
Mail list logo