Created
July 13, 2019 00:33
-
-
Save paleolimbot/e25d8edd651dad08e8e5e24dcbd3570b 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(ggplot2) | |
symmetric_range <- function(range) { | |
max_abs <- max(abs(range)) | |
c(-max_abs, max_abs) | |
} | |
ggplot(mpg, aes(cty, hwy)) + | |
geom_point() + | |
scale_x_continuous(limits = symmetric_range) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created on 2019-07-12 by the reprex package (v0.2.1)