[R] parallel coordinate plot showing density of curves

Jim Lemon jim at bitwrit.com.au
Tue Feb 4 07:53:02 CET 2014


On 02/04/2014 12:41 PM, Michael Friendly wrote:
> Given a set of numeric variables and a group factor, as in the iris data
> used below,
> I`d like to show a parallel coordinate plot, where instead of trace
> lines, I want
> to show something of the density distribution of the variable values for
> each
> group.
>
> Some approximations to what I want are shown below, using lattice,
> and simple techniques to show density *visually*, varying the amount
> of "ink".
>
> I'd like to know if there is a *statistical* implementation that would do
> something like this, either in the lattice or ggplot2 families. (I'm sure
> there is, but any help with syntax would be appreciated.)
>

Hi Michael,
I may be completely off the track here, but just on the off chance...

data(iris)
library(plotrix)
x11(width=6,height=10)
oldpar<-panes(nrow=3,ncol=1)
par(mar=c(5,4,4,2))
dendroPlot(iris[iris$Species=="setosa",1:4],breaks=list(10,10,10,10),
  setlabels=names(iris)[1:4],main="Setosa",xlab="Measurement",ylab="Cm")
dendroPlot(iris[iris$Species=="versicolor",1:4],breaks=list(10,10,10,10),
  setlabels=names(iris)[1:4],main="Versicolor",xlab="Measurement",ylab="Cm")
dendroPlot(iris[iris$Species=="virginica",1:4],breaks=list(10,10,10,10),
  setlabels=names(iris)[1:4],main="Virginica",xlab="Measurement",ylab="Cm")
par(oldpar)

Jim




More information about the R-help mailing list