Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. airquality %>%
  2. ggplot(aes(Ozone)) +
  3. geom_histogram(fill = "blue", binwidth = 5) +
  4. theme_light() +
  5. labs(x = "Ozone", y = "Count")
  6.  
  7. # If interested in only viewing Ozone between 0 and 50 :
  8.  
  9. # First way
  10. airquality %>%
  11. ggplot(aes(Ozone)) +
  12. geom_histogram(fill = "blue", binwidth = 5) +
  13. theme_light() +
  14. labs(x = "Ozone", y = "Count") +
  15. xlim(c(0,50))
  16.  
  17. # But values near 0 and 50 are excluded
  18. # Better way :
  19.  
  20. airquality %>%
  21. ggplot(aes(Ozone)) +
  22. geom_histogram(fill = "blue", binwidth = 5) +
  23. theme_light() +
  24. labs(x = "Ozone", y = "Count") +
  25. coord_cartesian(xlim = c(0,50))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement