DVC Day 25: Depth vs. Price/Carat

(This Post is part of my 30 day Data Visualization Challenge – you can follow along using the ‘challenge’ tag!)

When we take a closer look at this data, adding a bit more complexity – here, price per carat rather than simply carat weight – helps us to see that even as the lower clarities become larger, their price per carat stays consistently low. It’s also interesting to see that there appears to be no relationship at all between price/carat and a stone’s depth.

Screen Shot 2015-05-09 at 5.16.36 PM

Thoughts:
– The violin plot is added on top to help alleviate some of the dot density issues with such a large data set.
– Five days to go! Really this time 🙂

Code:

> p=ggplot(diamonds, aes(depth, price/carat))
> p + geom_point(color="gray", alpha=1/2) + facet_grid(.~clarity) + theme_bw() + geom_violin(color="blue", alpha=1/2)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.