s-news
[Top] [All Lists]

Re: horizontal boxplot

To: Karin <twentestat@yahoo.com>
Subject: Re: horizontal boxplot
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Wed, 21 May 2003 08:22:33 -0500
Cc: s-news@lists.biostat.wustl.edu
Organization: PDF Solutions, Inc.
References: <20030521130558.10744.qmail@web41312.mail.yahoo.com>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01


Karin wrote:
Hello,
Does anyone know what the command/parameter is in S-Plus to obtain a HORIZONTAL boxplot (instead of a vertical one)? Furthermore I want to display the value of the median for each box in the plot. Is that possible with the command text? Thanks! Karin


Forgot to answer your second question:

dframe <- data.frame(y = rnorm(100), g = rep(letters[1:4], 25))
bwplot(g ~ y,
       data = dframe,
       panel = function(x, y) {
         q <- round(tapply(x, y, median), 3)
         text(q, unique(y) + .15, format(q, nsmall = 3))
         panel.bwplot(x, y)
       })

Best,
Sundar


<Prev in Thread] Current Thread [Next in Thread>