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