Skip to content
Prev 59108 / 398502 Next

Simple plot() question

Hi Mick:

I'm a little unsure if this is what you are after but does this do it?

foo.mat <- matrix(rnorm(100), nrow = 10, ncol = 10)
plot(foo.mat[1,], type="l", xlab = "Crud", ylab = "More Crud")
plot(foo.mat[1,order(foo.mat[1,])], type="l", xaxt = "n", xlab = "Crud",
ylab = "More Crud")
axis(1, at=1:length(foo.mat[1,]), labels= order(foo.mat[1,]))


Seems like a barplot might be a nice way to go too:
barplot(foo.mat[1,order(foo.mat[1,])], names.arg = order(foo.mat[1,]))


A reproducible example would help the list see what you are after as I might
be totally off on this.
HTH, Andy
http://www.R-project.org/posting-guide.html