I want to plot the results of throwing a dice in a bar chart using ggplot.
import numpy
import ggplot
import pandas
frame = pandas.DataFrame()
for i in range(6):
frame.loc[i, 'pips'] = i+1
rand = numpy.random.random_integers(1, 6, 100)
for i in range(len(count)):
frame.loc[i, 'events'] = numpy.sum(rand == i+1)
frame['propability'] = frame.events / frame.events.sum()
ggplot.ggplot(ggplot.aes(x='pips', weight='events'), frame) + ggplot.geom_bar()
The outcome is 
From the examples I expected the plot to
- Have more width on each bar
- Not have x=7 with no bar
How do I fix these two things?
