Advertisement
Acapello

Untitled

Feb 13th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. options(scipen=999) # turn-off scientific notation like 1e+48
  2. library(ggplot2)
  3. theme_set(theme_bw()) # pre-set the bw theme.
  4. data("midwest", package = "ggplot2")
  5. # midwest <- read.csv("http://goo.gl/G1K41K") # bkup data source
  6.  
  7. # Scatterplot
  8. gg <- ggplot(midwest, aes(x=area, y=poptotal)) +
  9. geom_point(aes(col=state, size=popdensity)) +
  10. geom_smooth(method="loess", se=F) +
  11. xlim(c(0, 0.1)) +
  12. ylim(c(0, 500000)) +
  13. labs(subtitle="Area Vs Population",
  14. y="Population",
  15. x="Area",
  16. title="Scatterplot",
  17. caption = "Source: midwest")
  18.  
  19. plot(gg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement