I'm plotting a graphic, and I need to put an index on my greek letter, like $\lambda_1$ and $\lambda_2$. But I just don't know hot to put these indexes $1$ and $2$ into $\lambda$'s.
Here is what I tried:
gridd1 = c(0.10, 1.08, 8.92, 9.90)
gridd2 = c(0.10, 1.08, 8.92, 9.90)
gridd = expand.grid(gridd1,gridd2)
grid1 = gridd$Var1
grid2 = gridd$Var2
gridd<-
data.frame(x=gridd$Var1,y=gridd$Var2,col=as.character("Other Points"),stringsAsFactors=FALSE)
gridd[c(1,2,5,6),"col"]<-"A"
gridd[c(3,4,7,8),"col"]<-"B"
gridd[c(9,10,13,14),"col"]<-"c"
gridd[c(11,12,15,16),"col"]<-"D"
bellow is the code for the graphic
ggplot(gridd, aes(x=grid1, y=grid2, group=col)) +
geom_point(aes(shape=col, color=col, size = col),show.legend = FALSE)+
scale_shape_manual(values=c(19,19,19,19))+
coord_cartesian(xlim = c(.42, 9.57), ylim = c(.43,9.6))+
scale_size_manual(values=c(4,4,4,4)) +
scale_color_manual(values=c('green','blue','yellow','black'))+
#geom_abline(slope=1, intercept=0)+
geom_hline(yintercept=4.8)+
geom_text(label ="lambda",
parse = TRUE, x = 5, y = 7.5,cex=10)+
geom_text(label ="lambda",
parse = TRUE, x = 5, y = 2.5,cex=10)
I expect to put indexes 1 and 2, for the $\lambda$'s on the graphic. I tried to using lambda_1
, without success.