From felix at nfrac.org  Thu Jul 24 05:16:22 2008
From: felix at nfrac.org (Felix Andrews)
Date: Thu, 24 Jul 2008 13:16:22 +1000
Subject: [Rd] plot.dendrogram xlim/ylim
Message-ID: <94730b8a0807232016k11a953e6pf0b22c80fc6f36f9@mail.gmail.com>

list(...),

I would like to zoom in to the leaves of large trees in a dendrogram
plot. The playwith package allows zooming by passing xlim and ylim
arguments to the plot call (Hmisc does this too I think). But
currently stats:::plot.dendrogram does not accept xlim or ylim. So I
would like to enable that. In place of the existing code chunk:

    xlim <- c(x1 - 1/2, x2 + 1/2)
    ylim <- c(0, yTop)
    if (horiz) {
        xl <- xlim
        xlim <- rev(ylim)
        ylim <- xl
        tmp <- xaxt
        xaxt <- yaxt
        yaxt <- tmp
    }
    plot(0, xlim = xlim, ylim = ylim, ......

I propose something like:

function(..., xlim, ylim)

    xlim0 <- c(x1 - 1/2, x2 + 1/2)
    ylim0 <- c(0, yTop)
    if (horiz) {
        xl <- xlim0
        xlim0 <- rev(ylim0)
        ylim <- xl
        tmp <- xaxt
        xaxt <- yaxt
        yaxt <- tmp
    }
    if (missing(xlim)) xlim <- xlim0
    if (missing(ylim)) ylim <- ylim0
    plot(0, xlim = xlim, ylim = ylim, ......


Regards,
Felix

-- 
Felix Andrews / ???
PhD candidate
Integrated Catchment Assessment and Management Centre
The Fenner School of Environment and Society
The Australian National University (Building 48A), ACT 0200
Beijing Bag, Locked Bag 40, Kingston ACT 2604
http://www.neurofractal.org/felix/
3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8



[Rd] plot.dendrogram xlim/ylim
Felix Andrews