s-news
[Top] [All Lists]

Re: legend for graph with "vary symbol size" by column z (con

To: "'Golubiewski Nancy'" <golubiew@cires.colorado.edu>, s-news@wubios.wustl.edu
Subject: Re: legend for graph with "vary symbol size" by column z (con
From: "Austin, Matt" <maustin@amgen.com>
Date: Tue, 25 Jan 2005 20:03:05 -0800
The following may work:

x <- rnorm(100)
y <- rnorm(100)
z <- runif(100, 0, 5)

plot(x, y, type = 'n')
apply(cbind(x,y,z), 1, function(k) points(k['x'], k['y'], cex=k['z']))

key( x = par('usr')[1], y = par('usr')[3] - par('cxy')[2],
     points = list( pch = c(1, 1, 1), cex=c(1, 3, 5)),
     text   = list( as.character(c(1,3,5) )),
     columns = 3,
     transparent = TRUE)

--Matt

Matt Austin
Statistician

Amgen 
One Amgen Center Drive
M/S 24-2-C
Thousand Oaks CA 93021
(805) 447 - 7431


> -----Original Message-----
> From: s-news-owner@lists.biostat.wustl.edu
> [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Golubiewski
> Nancy
> Sent: Tuesday, January 25, 2005 19:49 PM
> To: s-news@wubios.wustl.edu
> Subject: [S] legend for graph with "vary symbol size" by column z
> (continuous variable)
> 
> 
> 
> 
> Ive plotted a scatter plot with x, y variables, and added information
> about a 3rd variable, z, by varying the symbol size.  Its a continuous
> variable, so the typical method for inserting a legend to detail the
> symbol size doesnt work (all examples Ive found in the Online 
> Programmers
> manual, Users manual, and menu interface work only when this 
> 3rd variable
> is categorical).  I could label a few of the data points, but 
> Id like to
> indicate how the symbol size varies through a legend. Is it 
> possible to
> force the legend to plot a representative symbol for 3 values 
> (e.g. 10,
> 100, 1000) in order to provide a scale?  Is it possible to 
> create a legend
> for this scenario at all?
> 
>   (Im using Splus 6.1).
> 
> 
> 
> Thanks in advance for your help.
> ~
> (Please reply to N.Golubiewski@massey.ac.nz)
> 
> --------------------------------------------------------------------
> 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>
  • Re: legend for graph with "vary symbol size" by column z (con, Austin, Matt <=