[R] Make Multiple plots in R

Chris Campbell ccampbell at mango-solutions.com
Thu Oct 31 18:24:43 CET 2013


Hi Jusper   
   
The function plot is generic; the method used to create the image depends on the type of the data object with which you are working. So for example calling plot on an "lm" object actually calls plot.lm.    
   
If you type:   
> class(mybrick9)   
   
You will see the class of your object. The plot is often created by a method named after that class. For example, if the object is a class "geomap" object, then the plot is created by plot.geomap. To read the help on this function, type:   
> ?plot.geomap    
   
If you want to check the methods available for your object, you can type:    
> methods(class = "geomap")   
   
I hope this helps.   
   
Best wishes   
   
Chris    


Chris Campbell, PhD   
Tel. +44 (0) 1249 705 450 | Mobile. +44 (0) 7929 628 349   
ccampbell at mango-solutions.com | http://www.mango-solutions.com   
Data Analysis the Delivers   
Mango Solutions   
2 Methuen Park, Chippenham, Wiltshire. SN14 OGB UK   

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Kiplimo, Jusper (ILRI)
Sent: 31 October 2013 11:09
To: r-help at r-project.org
Subject: [R] Make Multiple plots in R

Dear All,

I would wish to make multiple plots and give title/ headings same time, is there a simpler/ tidier way compared to below(, especially the headings as they are missing)? See output attached.

#####################################Making multiple Plots start########################

plot(mybrick9, y = 2, col = terrain.colors( length(seq(0,1, by = .2))-1),breaks= seq(0, 1, by = 0.2), axes = T,
     main = 'April 2006',
     xlab = 'Longitude', ylab = 'Latitude', 
     cex.lab = 1, cex.axis = 1 )
plot(mymap3, add = T)

plot(mybrick9, y = 5, col = terrain.colors( length(seq(0,1, by = .2))-1),breaks= seq(0, 1, by = 0.2), axes = T,
     main = 'May 2006',
     xlab = 'Longitude', ylab = 'Latitude', 
     cex.lab = 1, cex.axis = 1 )
plot(mymap3, add = T)

plot(mybrick9, y = 8, col = terrain.colors( length(seq(0,1, by = .2))-1),breaks= seq(0, 1, by = 0.2), axes = T,
     main = 'June 2006',
     xlab = 'Longitude', ylab = 'Latitude', 
     cex.lab = 1, cex.axis = 1 )
plot(mymap3, add = T)

plot(mybrick9, y = 11, col = terrain.colors( length(seq(0,1, by = .2))-1),breaks= seq(0, 1, by = 0.2), axes = T,
     main = 'July 2006',
     xlab = 'Longitude', ylab = 'Latitude', 
     cex.lab = 1, cex.axis = 1 )
plot(mymap3, add = T)

#####################################Making multiple Plots end########################

Regards,
Jusper	 

--

LEGAL NOTICE\ \ This message is intended for the use of ...{{dropped:18}}



More information about the R-help mailing list