ggplot for python

download ggplot for python

of 65

Embed Size (px)

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 of ggplot for python

  • ggplot for python Greg Lamp
  • ggplot What is it? Alternatives How it works Why should I use it? Tutorial
  • Here I am on the Internet. Founder/CTO @ Yhat Hi, Im Greg!
  • What is ggplot?
  • DSL for graphics
  • DSL for graphics scatterplot histogram labels color shape
  • What about matplotlib?
  • matplotlib syntax, api, default themes, learning curve
  • matplotlib maturity, ipython, customization, community syntax, api, default themes, learning curve
  • Facet all things www.gregreda.com
  • matplotlib ggplot
  • What about d3.js?
  • d3.js
  • ggplot
  • ggplot d3.js
  • How it works
  • Format
  • ggplot
  • data frame
  • aesthetics
  • Aesthetics
  • color
  • shape
  • size
  • ...fill, alpha, slope, intercept, ymin, ymax, ...
  • Geoms, Stats, & Scales
  • geom_point
  • geom_area
  • ...there are many
  • stat_smooth
  • ...there are a few
  • scale_color_brewer
  • scale_color_gradient
  • ...there are many
  • Layers
  • +
  • + +
  • + + ggplot() geom_point() stat_smooth()+ +
  • ggplot() + geom_point() + stat_smooth()
  • Why is this good?
  • Makes reasonable assumptions
  • not real colors
  • matplotlib freaks
  • still not real colors ...but i can guess what you mean
  • Concise yet expressive
  • Looks pretty good (and is easy to customize)
  • Seaborngithub.com/mwaskom/seaborn
  • Tutorial
  • github.com/glamp/ggplot-tutorial/ OR http://blog.yhathq.com/posts/facebook-ggplot-tutorial.html
  • Whats next
  • http://ggplot.yhathq.com
  • Thanks! @theglamp g@yhathq.com