Federico Calboli wrote:> Dear All, > > I would like to ask how to customize the graph corresponding to a > procrustes analysis. ><SNIP> The object returned by procrustes() contains Yrot and X, the rotated matrix and the target matrix respectively. You could plot both of these using standard plotting tools. You'll need to make the axes have the same scale. plot(mod.pro$Yrot, asp = 1) points(mod.pro$X, col = "red", pch = 16) Which seems to get you a similar plot to the one plot(mod.pro) produces.> > Regards, > > Federico CalboliHTH Gavin
Dear All, I would like to ask how to customize the graph corresponding to a procrustes analysis. I have to distance matrices, that I transform to two set of coordinates by means of muti dimensional scaling: library(mva) c1<-cmdscale(mat.dist1) c2<-cmdscale(mat.dist2) I vant to rotate c2 on c1, and I use the "procrustes" analysis from the {vegan} library. library(vegan) mod.pro<-procrustes(c1,c2) plot(mod.pro) My problem is that I need to change the graphical output of plot(mod.pro). The standard output gives empty circles for the rotated c2 matrix and arrows pointing to the target c1 matrix. I would like to have two set of symbols, one for c1 and the other for c2, with a line connecting the corresponding points or at worst I would like to have circles for the point of the target matix and the arrows pointing to the rotated matrix. I tried some manipulations based on the standard "plot" function, but I was quite unsucessful. Can anyone give advice? I am happy to give a toy example if needed. Regards, Federico Calboli -- ================================ Federico C. F. Calboli Dipartimento di Biologia Via Selmi 3 40126 Bologna Italy tel (+39) 051 209 4187 fax (+39) 051 251 208 f.calboli at ucl.ac.uk
> The `plot.procrustes' function really should be more user-friendly and > flexible. You should contact its author and ask for amendments.I honestly though my problem was too trival to bother the author in person, and I thought that getting an answer would leave it in a public database, as future reference. I hope I did not cause undue inconvenience.> However, > you have access to the internal results of the Procrustes analysis, and > you can produce any kind of plots with them. The needed matrices are > stored as items mod.pro$X and mod.pro$Yrot in your result object > mod.pro. The following should do what you asked for: > > plot(mod.pro$X, asp=1, pch=1) > points(mod.pro$Yrot, pch=2) > segments(mod.pro$X[,1], mod.pro$X[,2], mod.pro$Yrot[,1], > mod.pro$Yrot[,2])The above solves my problem. Thanks for your help. Best regards, Federico Calboli -- ================================ Federico C. F. Calboli Dipartimento di Biologia Via Selmi 3 40126 Bologna Italy tel (+39) 051 209 4187 fax (+39) 051 251 208 f.calboli at ucl.ac.uk