How do I tell R to fill the circle dots with colour on a scatter plot?
r
Solution
Color name is without spaces, try `"lightgreen"` instead
Example
set.seed(1) # some random data
x <- rnorm(20, 5)
y <- 2 + .78*x + rnorm(20)
plot(y~x, pch=21, bg="lightgreen")
which produces:
Problem
I want to fill the solid circle dots on my scatterplot with colour. I have tried this: ``` > plot(dframe1$TV~dframe1$Books) > xlab="Number of books read per month" > plot(dframe1$TV~dframe1$Books, xlab="Number of books read per month") > plot(dframe1$TV~dframe1$Books, xlab="Number of books read per month", ylab="Hours of TV watched per week", main="Associations between time spent watching TV and reading", col.main="red", cex=1.5, pch=21, bg=”light green”) Error: unexpected input in: "pch=21,bg=”" ``` It does not work. I would appreciate advice/help. :)