I've been working on a way to visualize a spearman correlation. That seemed
pretty simple:

#### generate skewed data
x = rnorm(100)^2
y = .6*x + rnorm(100, 0, sqrt(1-.6^2))

plot(x,y)  #### regular plot

plot(rank(x),rank(y), xaxt="n", yaxt="n")  ### spearman-like plot

#### make axis labels
axis(1, at=quantile(rank(x)), labels=round(quantile(x), digits=2))
axis(2, at=quantile(rank(y)), labels=round(quantile(y), digits=2))

However, transforming the data into ranks eliminates any information we
have about the distributions of the data. My solution to this problem is to
plot the densities outside the x/y axis with the mode of the distribution
pointing away from the plot. I've seen plots like this in textbooks, but
can't think of a way to do this in R.

Any ideas?

	[[alternative HTML version deleted]]

