3D Scatterplot in R


Today, I was doing some analysis of a sub-group of our constituents and was trying to get an idea of how connected these folks felt to our school.

I thought I’d do that by running a summary of their lifetime giving, event attendance and number of development officer contacts:

That shows me the 5-number breakdown for each column. Obviously, I’ve got some serious outliers in there, somebody’s who’s attended over 200 events!

But I can’t tell if the person w/ 200+ events is the same person who’s given a ton of money or not, so I tried running some scatterplots comparing the numbers:

lifetime giving vs event attendance

That’s not awful, but I have to run a bunch of these to compare all three variables–if I could run a legitimately 3D scatterplot in R, I’d be able to see all three variables at once.

Turns out, it’s REALLY easy.

3D scatterplot

click to zoom, rotate and pan
(embedding a live htmlwidget in WordPress made me crazy)

That gives you a really cool, pannable 3D scatterplot so you can see how each person compares on all three variables at once.

To tell the truth, it’s a bit gimmicky (and what do you do when you’ve got more than three variables? you’re back in the same boat). Still, it’s just so cool and fun that I had to share!

2 Replies to “3D Scatterplot in R”

  1. I’ve been playing with scatterplot3, and love it, but the one thing I can’t get working is the mouse-over labels for the data points. In my case, it’s important to know, because each point represents a different product/brand. Have you had any success in this?

    1. I haven’t. To be honest I didn’t pursue 3D plotting much beyond this post – most of the time, facets provide a lot more legible third dimension.

      But proper 3D stuff just looks so cool!

Leave a Reply

Your email address will not be published. Required fields are marked *