[R] ggplot

Alaios alaios at yahoo.com
Fri Apr 22 13:27:17 CEST 2011


Hello everyone,

I am using ggplot

to plot but I am getting the following error which I do not understand

Error: geom_text requires the following missing aesthetics: label


My code is
  dimx<-256

  library(ggplot2)
  dev.new()
  xandy<-expand.grid(seq(1:dimx),seq(1:dimy))
  xx<-data.frame(xandy[[1]],xandy[[2]],Powermap=Powermap)
  subsetxx<-subset(xx, xx$Powermap>threshold)
  
  ggplot( (subsetxx ) )+
  geom_point(aes(x,y,colour=cut(Powermap,c(0,-1,-10,-20,-30,-40,-50,-60,-70,-80,-90,-100,-110))))+
  geom_text(aes(x,y,color=cut(Powermap, c(0,-1,-10,-20,-30,-40,-50,-60,-70,-80,-90,-100,-110)), label=round(Powermap,3)),vjust=1,legend=FALSE)+labs(colour="Powermap")+
  coord_cartesian(xlim = c(1, dimx),ylim = c(1, dimy))



More information about the R-help mailing list