|
From: Amit S. <ami...@gm...> - 2014-12-03 20:52:30
|
On Thu, Dec 4, 2014 at 6:45 AM, Brendan Barnwell <bre...@br...> wrote:
> On 2014-12-03 12:39, Amit Saha wrote:
>>
>> Hi,
>>
>> Please find attached a simple histogram created using the hist()
>> function. Any idea why the last two bars are squeezed into each other?
>> Is there a simple way to fix this while plotting?
>
>
> It looks like the bins are set up so that there are empty bins
> between each of the other bars. How are you setting the bins? You could
> try adjusting the bin boundaries.
Thanks for the reply. This is my program:
import matplotlib.pyplot as plt
import random
def roll():
return random.randint(1, 6)
if __name__ == '__main__':
rolls = []
for i in range(1000):
rolls.append(roll())
# create a histogram plot
plt.hist(rolls)
plt.show()
So, just using the hist() function for now.
Thanks, Amit.
>
> --
> Brendan Barnwell
> "Do not follow where the path may lead. Go, instead, where there is no
> path, and leave a trail."
> --author unknown
--
http://echorand.me
|