Skip to content
Prev 175633 / 398513 Next

3d cloud plot with point size reflecting variable value

On Tue, Mar 31, 2009 at 8:57 AM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
How so? panel.3dscatter() in fact goes to some lengths to be
vectorized: 'n' is the number of points being plotted, and 'cex' is
replicated to be equally long here. This is needed so that the 'cex'
values can later be reordered in the same way as the points being
plotted (by decreasing depth). The following should work:

cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, pch = 1,
cex = with(iris, 3 * Sepal.Width / max(Sepal.Width)))

One caveat is that this will not work in a multi-panel plot. In that
case, a custom panel function will need to create a suitable subset of
'cex' (cex[subscripts]) before calling panel.3dscatter().

-Deepayan