On 11-01-12 9:33 PM, John Sorkin wrote:
> I would like to plot 3-dimensional data on a two-dimensional scatter-plot. > Is there a way I can automatically modify the plot symbol (e.g. changing size or color) to indicate the value of a third variable? E.g. How can I plot weight vs. age and indicate the value of muscle mass for each value weight-age pair by making the plot point proportional to the subject's muscle mass?

Just set cex to the other variable.  For example,

plot(1:10, 1:10, cex=1:10)

Similarly, col and pch can be set to vector values, which are recycled through the points.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to