ggplot

http://blog.yhathq.com/posts/ggplot-for-python.html

  • Package created by the yhat team
  • focuses on duplicating the API and output of R's ggplot2 library
In [1]:
%run talktools
%matplotlib inline

Now you can create matplotlib plots using R-like syntax:

In [2]:
from ggplot import *

ggplot(meat, aes('date','beef')) + \
    geom_line(color='black') + \
    scale_x_date(breaks=date_breaks('7 years'), labels='%b %Y') + \
    scale_y_continuous(labels='comma')
Out[2]:
<ggplot: (277992673)>

ggplot also natively handles Pandas DataFrames:

In [3]:
import pandas as pd

meat_lng = pd.melt(meat, id_vars=['date'])

p = ggplot(aes(x='date', y='value'), data=meat_lng)
p + geom_point() + \
    stat_smooth(colour="red") + \
    facet_wrap("variable")
Out[3]:
<ggplot: (275062373)>

Former R users who have switched to Python: this may be what you're looking for!

Read more at http://blog.yhathq.com/posts/ggplot-for-python.html