[19213] in s-news-athena

home help back first fref pref prev next nref lref last post

Re: [S]: summary: how to customize boxplot "names" (fwd)

daemon@ATHENA.MIT.EDU (Bin Chen)
Mon Sep 13 19:18:08 1999

From: pbchen@gsbphd.uchicago.edu (Bin Chen)
To: s-news@wubios.wustl.edu
Date: Mon, 13 Sep 1999 23:11:16 GMT
Message-Id: <37dd8356.10261852@gsbpop.uchicago.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit


Thanks to Mr. Dunlap again for pointing out that boxplot actually
returns the x-coordinates implicitly:

On Mon, 13 Sep 1999 15:37:43 -0700 (PDT), Bill Dunlap
<bill@statsci.com> wrote:

>On Mon, 13 Sep 1999, Bin Chen wrote:
>
>> boxplot(split(data,group),names=my.names,axes=F)
>> axis(1,at=seq(2,98,96/34),labels=F)
>> 
>> Somehow S-Plus uses a range between 0 and 100 to plot the "names", but
>> the exact position for the first and last "names" seems to be 2 and
>> 98, respectively. In my case I have 35 years (1960-1994), so ...
>
>Your numbers are close in this case but the exact ones are given by the return
>value of boxplot().  It isn't generally printed but you can save it
>and use it:
>
>> x <- boxplot(split(state.x77[,"Frost"], state.region), names=rep("",4))
>> x
>[1] 15.00000 38.33333 61.66666 85.00000
>> axis(1, at=x, lab=abbreviate(levels(state.region)))
>
>If you had 35 groups they would be at
>
>> x <- boxplot(split(1:35, 1960:1994), names=rep("",35))
>> x
> [1]  1.878307  4.708995  7.539682 10.370371 13.201059 16.031748 18.862436
> [8] 21.693125 24.523813 27.354502 30.185190 33.015877 35.846565 38.677254
>[15] 41.507942 44.338631 47.169319 50.000008 52.830696 55.661385 58.492073
>[22] 61.322762 64.153450 66.984131 69.814819 72.645508 75.476196 78.306885
>[29] 81.137573 83.968262 86.798950 89.629639 92.460327 95.291016 98.121704
>
>not quite the same as
>
>> seq(2,98,96/34)
> [1]  2.000000  4.823529  7.647059 10.470588 13.294118 16.117647 18.941176
> [8] 21.764706 24.588235 27.411765 30.235294 33.058824 35.882353 38.705882
>[15] 41.529412 44.352941 47.176471 50.000000 52.823529 55.647059 58.470588
>[22] 61.294118 64.117647 66.941176 69.764706 72.588235 75.411765 78.235294
>[29] 81.058824 83.882353 86.705882 89.529412 92.352941 95.176471 98.000000
>
>----------------------------------------------------------------------------
>Bill Dunlap                                      22461 Mt Vernon-Big Lake Rd
>Data Analysis Products Div. of MathSoft, Inc.    Mount Vernon, WA 98274
>bill@statsci.com                                 360-428-8146
>
>"All statements in this message represent the opinions of the author and do
>not necessarily reflect MathSoft policy or position."
>

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post