Skip to content

Instantly share code, notes, and snippets.

@erichare
Last active November 25, 2019 15:18
Show Gist options
  • Save erichare/5de046d47fd6274b62111ed1e693b6cc to your computer and use it in GitHub Desktop.
Save erichare/5de046d47fd6274b62111ed1e693b6cc to your computer and use it in GitHub Desktop.
Some new features in the scales 1.1 release
library(ggplot2)
ggplot(data = diamonds, aes(x = carat, y = price, colour = clarity)) +
geom_point() +
scale_y_continuous(labels = scales::dollar,
breaks = scales::breaks_width(2000)) +
scale_x_continuous(breaks = scales::breaks_width(.5))
ggplot(data = diamonds, aes(x = carat, y = price, colour = clarity)) +
geom_point() +
scale_y_continuous(labels = scales::label_number_si(),
breaks = scales::breaks_width(2000)) +
scale_x_continuous(breaks = scales::breaks_width(.5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment