Message-ID: <4D2E8975.9000107@gmail.com>
Date: 2011-01-13T05:11:17Z
From: Duncan Murdoch
Subject: 2d plot with modification of plotting symbol to indicate third dimension.
In-Reply-To: <4D2E1E3D020000CB0007DC58@medicine.umaryland.edu>
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