Implementation of parallel coordinates?

discipulus picture discipulus · Oct 15, 2010 · Viewed 10.7k times · Source

I want to implement parallel coordinates for my muldimensional result. Does anyone have a good link to its implementation in matlab or R? Furthermore, are there any suggestions regarding the best tool to use for producing the parallel coordinates?

Answer

VitoshKa picture VitoshKa · Oct 15, 2010

R solution

lattice package comes with R and includes parallel function:

 parallel(~iris[1:4] | Species, iris) 

alt text

ggplot2 is also your friend here:

D <- data.frame(Gain = rnorm(20),  
                Trader = factor(LETTERS[1:4]), 
                Day = factor(rep(1:5, each = 4)))
ggplot(D) + 
  geom_line(aes(x = Trader, y = Gain, group = Day, color = Day))

alt text

lattice and ggplot require input data in different "shapes". For lattice it's a matrix form, each column is a variable represented on one parallel coordinate. For ggplot it's one column (Gains) and a separate indicator for the variable (Trader above). /this is the reason I used two different examples, not to mess with data reshaping here/.

If you need something quick, then lattice is probably for you. Ggplot requires some time investment.