On Thu, Dec 4, 2014 at 6:45 AM, Brendan Barnwell <brenb...@brenbarn.net> 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

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to