[R] Question about ggplot2 symbol and legend change
Luis Fernando García
luysgarcia at gmail.com
Tue Oct 11 04:25:08 CEST 2016
Dear R experts,
Maybe my question is too basic and I apologize for that. I am having an
issue currently by trying to change manually the symbols of the series. I
need to put them manually, instead of using the symbols that R gives by
default and produce a plot with the classic style. For example I need to
put the symbols 16 and 2, but I have been unable to do it so far. Also, I
need to remove the grey background from the seiries but I have been unable
to do it too.
Any help you can provide will be really helpful.
Below, I am providing the script as well as the picture I gio with it If
necessary I added the dataset.
Many thanks
#################################################################################
it<-read.table("immotime.txt",header=TRUE)
it
str(it)
names(it)
fit3<-lm(Time ~ Sp*Ratio, data=it)
anova(fit3)
plot(fit3)
summary(fit3)
a$lPeso <- log(Peso)
library(ggplot2)
p <- ggplot(it,aes(x=Ratio,y=Time)) + geom_point(aes(shape=factor(Sp)))
p=p + geom_smooth(aes(linetype=factor(Sp), ),colour="black", method='lm',
se=F)+theme(panel.grid.major = element_blank(), panel.grid.minor =
element_blank(),
panel.background = element_blank(), axis.line =
element_line(colour = "black"))
p
#################################################################################
Plot: https://postimg.org/image/3vm2uleip/
dataset "it" http://textuploader.com/d593h
[[alternative HTML version deleted]]
More information about the R-help
mailing list