How to make a histogram in ipython notebook using ggplot2 (for python)
问题 I'm trying to make a histogram of a simple list of numbers in python using ipython notebook and ggplot for python. Using pylab, it's easy enough, but I cannot get ggplot to work. I'm using this code (based on the diamond histogram example, which does work for me): from ggplot import * a = [1, 1, 2, 1, 1, 4, 5, 6] p = ggplot(aes(x='carat'), data=a) p + geom_hist() + ggtitle("Histogram of Diamond Carats") + labs("Carats", "Freq") Using ipython & pylab, I can make a histogram with just hist(a)