ggplot for python SV 2014

746 views
584 views

Published on

Making basic, good-looking plots in Python is tough. Matplotlib gives you great control, but at the expense of being very detailed. The rise of pandas has made Python the go-to language for data wrangling and munging but many people are still reluctant to leave R because of its outstanding data viz packages. ggplot is a port of the popular R package ggplot2. It provides a high level grammar that allow users to quickly and easily make good looking plots. So say good-bye to matplotlib, and hello to ggplot as your everyday Python plotting library! https://github.com/yhat/ggplot

Published in: Data & Analytics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
746
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

ggplot for python SV 2014

  1. 1. ggplot for python Greg Lamp
  2. 2. ggplot ● What is it? ● Alternatives ● How it works ● Why should I use it? ● Tutorial
  3. 3. Here I am on the Internet. Founder/CTO @ Yhat Hi, I’m Greg!
  4. 4. What is ggplot?
  5. 5. DSL for graphics
  6. 6. DSL for graphics scatterplot histogram labels color shape
  7. 7. What about matplotlib?
  8. 8. matplotlib syntax, api, default themes, learning curve
  9. 9. matplotlib maturity, ipython, customization, community syntax, api, default themes, learning curve
  10. 10. “Facet all things” www.gregreda.com
  11. 11. matplotlib ggplot
  12. 12. What about d3.js?
  13. 13. d3.js
  14. 14. ggplot
  15. 15. ggplot d3.js
  16. 16. How it works
  17. 17. Format
  18. 18. ggplot
  19. 19. data frame
  20. 20. “aesthetics”
  21. 21. Aesthetics
  22. 22. color
  23. 23. shape
  24. 24. size
  25. 25. ...fill, alpha, slope, intercept, ymin, ymax, ...
  26. 26. Geoms, Stats, & Scales
  27. 27. geom_point
  28. 28. geom_area
  29. 29. ...there are many
  30. 30. stat_smooth
  31. 31. ...there are a few
  32. 32. scale_color_brewer
  33. 33. scale_color_gradient
  34. 34. ...there are many
  35. 35. Layers
  36. 36. +
  37. 37. + +
  38. 38. + + ggplot() geom_point() stat_smooth()+ +
  39. 39. ggplot() + geom_point() + stat_smooth()
  40. 40. Why is this good?
  41. 41. Makes “reasonable assumptions”
  42. 42. not real colors
  43. 43. matplotlib freaks
  44. 44. still not real colors ...but i can guess what you mean
  45. 45. Concise yet expressive
  46. 46. Looks pretty good (and is easy to customize)
  47. 47. Seaborngithub.com/mwaskom/seaborn
  48. 48. Tutorial
  49. 49. github.com/glamp/ggplot-tutorial/ OR http://blog.yhathq.com/posts/facebook-ggplot-tutorial.html
  50. 50. What’s next
  51. 51. http://ggplot.yhathq.com
  52. 52. Thanks! @theglamp g@yhathq.com

×