Skip to content Skip to sidebar Skip to footer

Plot Histogram Of Datetime.time Python / Matplotlib

I am trying to plot a histogram of datetime.time values. Where these values are discretized into five minute slices. The data looks like this, in a list: ['17:15:00', '18:20:00', '

Solution 1:

I did what David Zwicker said and used seconds, and then changed the x axis. I will look at what Dave said about 'bins'. This works roughly and gives a bar per hour plot to start with.

def chart(occurance_list):
    hour_list = [t.hour for t in occurance_list]
    print hour_list
    numbers=[x for x in xrange(0,24)]
    labels=map(lambda x: str(x), numbers)
    plt.xticks(numbers, labels)
    plt.xlim(0,24)
    plt.hist(hour_list)
    plt.show()

frequency of lowest daily exahange rate for GBPUSD

Post a Comment for "Plot Histogram Of Datetime.time Python / Matplotlib"