Created
February 20, 2018 22:51
-
-
Save MCMaurer/756befacf1963e4172f95bc65ec1df2b to your computer and use it in GitHub Desktop.
Creating a Tufte-style range-frame scatterplot using ggplot
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(ggplot2) | |
library(ggthemes) | |
ggplot(mtcars, aes(wt,mpg))+ | |
geom_point()+ | |
theme_tufte()+ | |
theme(axis.ticks = element_blank())+ | |
xlab("Car weight (lb/1000)")+ | |
ylab("Miles per gallon of fuel")+ | |
scale_x_continuous(breaks = round(as.vector(quantile(mtcars$wt)), digits = 1))+ | |
scale_y_continuous(breaks = round(as.vector(quantile(mtcars$mpg)), digits = 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment