Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Incomer per person (x axis) correlates with life expectancy (y axis). These two indicators change over time (z axis).

x correlates with y. Moreover, x and y both correlate with z.

The question is: what kind of plot should I use to visualize this? Maybe a 3D scatter plot?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

A three-dimensional scatter plot is good, but can sometimes be hard to interpret because you lose a dimension of information when you project it onto the two-dimensional page.

An alternative is to do multiple two-dimensional scatter plots. This is equivalent to making a three-dimensional plot and then looking at it from different angles. For example, in R you can generate some data using

> X = rnorm(100)
> Y = rnorm(100) + X
> Z = rnorm(100) - X

and collect it together into a single data frame object

> D = data.frame(X=X,Y=Y,Z=Z)

You can generate the sample correlation matrix with

> cor(D)
           X          Y          Z
X  1.0000000  0.7647313 -0.7487290
Y  0.7647313  1.0000000 -0.5407474
Z -0.7487290 -0.5407474  1.0000000

and finally generate the set of two-dimensional scatter plots

> plot(D)

enter image description here

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.