If you just want to make a histogram of the numbers in your "a" vector, there are a few problems.
First, ggplot accepts data in the form of a pandas Dataframe, so you need to create it first.
import pandas as pd a = [1, 1, 2, 1, 1, 4, 5, 6] df = pd.DataFrame(a, columns=['a'])
Secondly, the geometry of geom_histogram() not geom_hist() . And finally, it looks like you are dropping the code from one of the example diamond plots. You do not need this, so I deleted it.
from ggplot import * p = ggplot(aes(x='a'), data=df) p + geom_histogram(binwidth=1)

Oman
source share