Reputation: 957
I try to reproduce the tutorial examples for Python ggplot, which I installed with pip install ggplot
this is from yhat website here http://blog.yhathq.com/posts/ggplot-for-python.html:
import pandas as pd
from ggplot import *
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")
p + geom_hist() + facet_wrap("color")
p = ggplot(diamonds, aes(x='price'))
p + geom_density() + \
facet_grid("cut", "clarity")
p = ggplot(diamonds, aes(x='carat', y='price'))
p + geom_point(alpha=0.25) + \
facet_grid("cut", "clarity")
And I get:
NameError Traceback (most recent call last)
<ipython-input-15-41e6a9d7443f> in <module>()
5 p + geom_point() + stat_smooth(colour="red") + facet_wrap("variable")
6
----> 7 p + geom_hist() + facet_wrap("color")
8
9 p = ggplot(diamonds, aes(x='price'))
NameError: name 'geom_hist' is not defined
Upvotes: 1
Views: 1298
Reputation: 2319
geom_hist()
got renamed to geom_histogram()
. See here: http://ggplot.yhathq.com/docs/geom_histogram.html
Upvotes: 4