When use the example on p. 108 of the Wickam "ggplot2" text, and inlcude the follwoing line:plot + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3,4))the output plots no lines.I must be using the manual function incorrectly.Any suggestions?--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Thanks for the reply.
I must be doing something wrong.
When I enter the following :
plot + aes(shape=vore) + scale_shape_manual(value=c(1,2,6,0,23))
the data are plotted with five different symbols, one for each of five groups.
When the change is made from shapes to linetypes,
plot + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3,4))
no lines appear. The values 0,1,2,3,4 are allowed identifiers for different kinds of lines. I am confused.
That is my problem. Any thoughts?
plot <- qplot(brainwt, bodywt, data=msleep, log=”xy”)
does this help?
It happens that I need to put both symbols and lines on the plot, and I need to be able to choose the lines and symbols that are assigned. I seem to need to use scale_shape_manual and scale_linetype_manual to correctly set the desired symbols and lines, but the following code does not work with regard to the lines. Any suggestions?
##the following code seems to remove all nas for all variables used, I think.
ms <- msleep[ !is.na(msleep$vore) & !is.na(msleep$brainwt) & !is.na(msleep$bodywt),]
q1 <- qplot(brainwt,bodywt,data=ms)
q2 <- q1 + aes(shape=vore) + scale_shape_manual(value=c(1,2,6,0))
q3 <- q1 + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3))
q4 <- q2 + aes(linetype=vore) + scale_linetype_manual(value=c(0,1,2,3))
Also, how do I iissue an github?
Thanks