Here you are :)

plot_shad_f<-function(f){
  library(ggplot2)
  dev.new()
  plotdata<-melt(f)
  names(plotdata)<-c('x','y','z')
  v<-ggplot(plotdata, aes(x, y, z = z))
  print(v + geom_tile(aes(fill=z))) 

}


f<-matrix(data=seq(1:10000),nrow=100,ncol=100)
plot_shad_f(f)


I would like to add a circle at the middle of this region with a range of 10.

Best Regards

Alex

--- On Tue, 5/10/11, Scott Chamberlain <scttchamberla...@gmail.com> wrote:

From: Scott Chamberlain <scttchamberla...@gmail.com>
Subject: Re: [R] ggplot2 and add circle
To: "Alaios" <ala...@yahoo.com>
Cc: R-help@r-project.org
Date: Tuesday, May 10, 2011, 5:59 PM


            
                You should provide reproducible data in addition to your code. 
S

                
                
                
                
                On Tuesday, May 10, 2011 at 11:54 AM, Alaios wrote:
                
                    Dear all,
today I have writted the following code,
to plot the contents of some matrices I have

plot_shad_f
function(f){
  library(ggplot2)
  dev.new()
  plotdata<-melt(f)
  names(plotdata)<-c('x','y','z')
  v<-ggplot(plotdata, aes(x, y, z = z))
  print(v + geom_tile(aes(fill=z))) 
}

I would like to ask your help add a small circle in this plotting. What would 
be the easiest way to do that in ggplot2?

Best Regards
Alex

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

                
                
                
                
                
                
                
                    

                
            
        
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to