s-news
[Top] [All Lists]

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

To: Golubiewski Nancy <golubiew@cires.colorado.edu>, N.Golubiewski@massey.ac.nz
Subject: Re: legend for graph with "vary symbol size" by column z (continuous
From: Tim Hesterberg <timh@insightful.com>
Date: 26 Jan 2005 08:52:23 -0800
Cc: s-news@wubios.wustl.edu
In-reply-to: <Pine.GSO.4.43.0501252046001.2793-100000@cires.colorado.edu> (message from Golubiewski Nancy on Tue, 25 Jan 2005 20:49:19 -0700 (MST))
References: <Pine.GSO.4.43.0501252046001.2793-100000@cires.colorado.edu>
Try key(), which is much more flexible than legend().
The following example produces a simple legend with varying
point size:
        plot(1:2)
        key(text=c("big","small"), points=list(cex=c(2,1)))


>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)

========================================================
| Tim Hesterberg       Research Scientist              |
| timh@insightful.com  Insightful Corp.                |
| (206)802-2319        1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax)  Seattle, WA 98109-3044, U.S.A.  |
|                      www.insightful.com/Hesterberg   |
========================================================
Download the S+Resample library from www.insightful.com/downloads/libraries


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