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
|