s-news
[Top] [All Lists]

Re: [Question] multiple plot on a graph

To: s-news@wubios.wustl.edu
Subject: Re: [Question] multiple plot on a graph
From: "Jean V Adams" <jean_adams@usgs.gov>
Date: Wed, 26 Mar 2003 11:23:23 -0500
Cc: theo@unity.ncsu.edu
Here's one approach that works with traditional graphics using the command
window.

x <- 1:10
y <- 2*x + 3

r <- c(rnorm(10, 5), rnorm(10, 10), rnorm(10, 6), rnorm(10, 1))
f <- as.factor(rep(1:4, rep(10, 4)))

graphsheet()
par(mar=rep(5, 4))
plot(x, y, type="l")
par(new=T)
a <- boxplot(split(r, f), axes=F, names=rep(" ", 4))
axis(3, at=a, labels=levels(f))
axis(4)
mtext("f", side=3, line=3)
mtext("r", side=4, line=3)

JVA

`·.,,  ><(((º>   `·.,,  ><(((º>   `·.,,  ><(((º>

Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
c/o Marquette Biological Station
1924 Industrial Parkway
Marquette, MI 49855  U.S.A.
phone: (906) 226-1212
FAX: 906-226-3632
web site: www.glsc.usgs.gov
e-mail: jean_adams@usgs.gov
----- Forwarded by Jean V Adams/BRD/USGS/DOI on 03/26/2003 11:19 AM -----
                                                                                
                                                
                      Jean V Adams                                              
                                                
                                               To:      Tae-Young Heo 
<theo@unity.ncsu.edu>                                     
                      03/26/2003 10:49         cc:                              
                                                
                      AM                       Subject: Re: [S] [Question] 
multiple plot on a graph(Document link: Jean V       
                                               Adams)                           
                                                
                                                                                
                                                



Are you using the GUI (point and clicking on the menu) or the command
window (writing code)?  Are you using "traditional" graphics or Trellis
graphics?

JVA


                                                                                
                                                         
                      Tae-Young Heo                                             
                                                         
                      <theo@unity.ncsu.edu>            To:       
s-news@lists.biostat.wustl.edu                                          
                      Sent by:                         cc:                      
                                                         
                      s-news-owner@lists.biosta        Subject:  [S] [Question] 
multiple plot on a graph                                 
                      t.wustl.edu                                               
                                                         
                                                                                
                                                         
                                                                                
                                                         
                      03/26/2003 05:09 AM                                       
                                                         
                                                                                
                                                         
                                                                                
                                                         




I am trying to make a multiple plot on a graph. One plot is scatter plot
and the other is Boxplot.
Is it possible with S-plus?
I tried several ways,but failed.
I would like to get the graph that

Lower X-axis is for scatter plot and
Upper X-axis is for Boxplot and
Left  Y-axis is for scatter plot and
Right Y-axis is for Boxplot

                      r
          1   2   3   4   5    6    7
        -----------------------------------
        |          * * * * * * * * *      |
   46000| |      *                        |0.12
        |---    *                         |
y      || |   *                          |0.08
   45500|--- *                            |      m
        | | *                             |0.05
   45000| *                               |
        |                                 |0.01
        -----------------------------------
          1 2 3 4 5 6 7 8 9 10 11 12 13
                       d
Like above, I would like to draw two plot(scatter plot and Boxplot)on a
graph.
Please let me know how to draw tow plot(scatter plot and Boxplot) on a
graph with own X and Y axes.

Thanks


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







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