Skip to content
Prev 279855 / 398506 Next

ggplot with geom_tile

Dear Saskia,

If you mean the grid lines around the edge then they can be removed by using the following:

p <- ggplot(tot, aes(x=temp, y=precip,group=dis))
p+geom_tile(aes(fill=dis)) + scale_fill_gradientn(colours=cols) +
scale_x_continuous(expand = c(0,0)) +
scale_y_continuous(expand = c(0,0))

I hope this helps

I remain at your disposal should you have any questions.

Best regards,

Frederic Andrieu

M: +44(0)07813 526 123
T: +44 (0)1249 766 801? 
F: +44 (0)1249 767 707
www.mango-solutions.com 
Unit 2 Greenways Business Park
Bellinger Close
Chippenham
Wilts
SN15 1BN
UK 




-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Paul Hiemstra
Sent: 09 December 2011 11:23
To: Pelt van, Saskia (KNMI)
Cc: r-help at r-project.org
Subject: Re: [R] ggplot with geom_tile

Dear Saskia,

Thank you for the reproducible example, that helps a lot. I pasted you
code into R and got a perfectly fine image. You need to provide us with
your sessionInfo(). Mine is listed at the end of the mail. I seem to
remember having this problem with R 2.12. Therefore updating R might be
a good option.

hope this helps,
Paul
R version 2.13.0
(2011-04-13)                                                                                       

Platform: i686-pc-linux-gnu
(32-bit)                                                                                

                                                                                                                    

locale:                                                                                                             

 [1] LC_CTYPE=en_US.utf8      
LC_NUMERIC=C                                                                         

 [3] LC_TIME=en_US.utf8       
LC_COLLATE=en_US.utf8                                                                

 [5] LC_MONETARY=C            
LC_MESSAGES=en_US.utf8                                                               

 [7] LC_PAPER=en_US.utf8      
LC_NAME=C                                                                            

 [9] LC_ADDRESS=C             
LC_TELEPHONE=C                                                                       

[11] LC_MEASUREMENT=en_US.utf8
LC_IDENTIFICATION=C                                                                  

                                                                                                                    

attached base
packages:                                                                                             

[1] grid      stats     graphics  grDevices utils     datasets 
methods                                             
[8]
base                                                                                                            

                                                                                                                    

other attached
packages:                                                                                            

[1] ggplot2_0.8.9  proto_0.3-9.2  reshape_0.8.4  plyr_1.6      
fortunes_1.4-2                                      
                                                                                                                    

loaded via a namespace (and not
attached):                                                                          

[1]
digest_0.5.1
On 12/09/2011 10:33 AM, Pelt van, Saskia (KNMI) wrote: