[Phylobase-commits] r200 - branches/pdcgsoc/misc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 14 09:45:28 CEST 2008


Author: pdc
Date: 2008-07-14 09:45:28 +0200 (Mon, 14 Jul 2008)
New Revision: 200

Modified:
   branches/pdcgsoc/misc/temp.R
Log:
abstracted to allow for arbitrary grid plot functions at tips
lattice plots will come later

Modified: branches/pdcgsoc/misc/temp.R
===================================================================
--- branches/pdcgsoc/misc/temp.R	2008-07-14 07:20:08 UTC (rev 199)
+++ branches/pdcgsoc/misc/temp.R	2008-07-14 07:45:28 UTC (rev 200)
@@ -1,12 +1,14 @@
 require(phylobase)
 require(grid)
+require(lattice)
 treePlot <- function(phy, 
                      type = 'phylogram', 
                      show.tip.label = TRUE, 
                      tip.order = NULL,
                      plot.data = FALSE,
-                     rot = 0
-                     ) 
+                     rot = 0,
+                     tip.plot.fun = function() {grid.points()}
+            )
     {
     
     if (type == 'phylogram') {
@@ -72,15 +74,13 @@
             name = 'data_plots'))
             
         for(i in xxyy$xxyy$yy[which(phy at edge[, 2] <= length(phy at tip.label))]) {
-            print(i)
             pushViewport(viewport(
                 y = i, 
                 height = unit(1, 'snpc'), 
                 width = unit(1, 'snpc'), 
                 name = paste('data_plot', i),
                 just = "center"))
-            grid.rect()
-            grid.points()
+                tip.plot.fun()
             popViewport()
         }
         popViewport()



More information about the Phylobase-commits mailing list