Suppose I have the following
y <- rnorm(10)
b <- as.factor(sample(1:4,10,replace=T))
qplot(1:10, y, shape=b)
How do I change the shapes that are used using ggplot2?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The ggplot way to do it would be to use
scale_shape_manualand provide the desired shapes in thevaluesargument:The shapes are the same as the usual 0-25 indexes: http://yusung.blogspot.com/2008/11/plot-symbols-in-r.html