[Phylobase-commits] r257 - branches/pdcgsoc/misc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Aug 6 21:26:41 CEST 2008
Author: pdc
Date: 2008-08-06 21:26:41 +0200 (Wed, 06 Aug 2008)
New Revision: 257
Modified:
branches/pdcgsoc/misc/temp.R
Log:
small simplification
Modified: branches/pdcgsoc/misc/temp.R
===================================================================
--- branches/pdcgsoc/misc/temp.R 2008-08-06 08:43:39 UTC (rev 256)
+++ branches/pdcgsoc/misc/temp.R 2008-08-06 19:26:41 UTC (rev 257)
@@ -84,7 +84,7 @@
pushViewport(viewport(
y = i,
x = 0.5,
- height = unit(1, 'snpc'), # snpc keeps the viewports sq
+ height = unit(1/Ntips, 'npc'), # snpc keeps the viewports sq
width = unit(1, 'snpc'),
name = paste('data_plot', i),
just = "center"
@@ -130,7 +130,7 @@
Ntips <- length(phy at tip.label)
tindex <- phy at edge[phy at edge[, 2] <= Ntips, 2]
eindex <- match(phy at edge[,2], xxyy$phy.orig at edge[,2])
- segs <- segs(phy, XXYY = xxyy)
+ segs <- segs(XXYY = xxyy)
## TODO check that colors are valid?
## TODO edge colors are required to be in the order of edge matrix
@@ -283,7 +283,8 @@
c(xxyy, phy = list(phy), phy.orig = list(phy.orig))
}
-segs <- function(phy, XXYY) {
+segs <- function(XXYY) {
+ phy <- XXYY$phy
treelen <- rep(NA, nrow(phy at edge) + 1)
segs <- list(v0x = treelen, v0y = treelen, v1x = treelen, v1y = treelen,
h0x = treelen, h0y = treelen, h1x = treelen, h1y = treelen)
@@ -405,15 +406,18 @@
# phylobubbles(foo)
## TODO true arbitary functions with data from associated data frames
+ff <- function() {grid.lines(1:10/10, runif(10))}
+
p1 <- treePlot(
geospiza,
# show.tip.label = FALSE,
show.node.label = TRUE,
- # edge.color = rainbow(nrow(geospiza at edge)),
+ edge.color = rainbow(nrow(geospiza at edge)),
+ # node.color = rainbow(nrow(geospiza at edge)),
# plot.data = FALSE,
- tip.plot.fun = function() {grid.lines(1:10/10, runif(10))},
+ # tip.plot.fun = ff,
tip.color = c('red', 'black', 'blue'),
- square = TRUE
+ square = FALSE
)
treeWpoly <- as(read.tree(text = '((a,b,c),d);'), 'phylo4')
@@ -423,6 +427,6 @@
# n <- 10
# tree1 <- as(rtree(n), 'phylo4')
# tree1 at tip.label <- replicate(n, paste(sample(LETTERS, sample(2:20, 1)), collapse = ""))
-# treePlot(tree1, type = "cladogram")
-#
+# treePlot(tree1)
+
More information about the Phylobase-commits
mailing list