Last active
July 17, 2020 23:37
-
-
Save ljanda/4cbaeec1091849dc65cb7a7fe3a86965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(scales) | |
data(diamonds) | |
diamonds %>% | |
filter(str_detect(cut, "Fair|Ideal")) %>% | |
ggplot(aes(price, carat)) + | |
geom_point(color = "skyblue", alpha = 0.5) + | |
facet_wrap(~cut, strip.position = "bottom") + | |
scale_x_continuous(labels = comma) + | |
labs(x = "Price", y = "Carat", | |
title = "Diamond Carat and Price for Worst and Best Cut", | |
subtitle = "Fair cut has fewer data points, more variation than ideal cut") + | |
theme_minimal() + | |
theme(strip.background = element_blank(), | |
strip.placement = "outside") | |
## https://github.com/tidyverse/ggplot2/issues/2622 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment