I've started with a data file consisting of one number per line, wide 
distribution of values. I've created a histogram out of it, showing the 
frequency of occurrence of values in about 200 bins. Even managed to do 
a log xscale.

#############################
import matplotlib.pyplot as plt
import numpy as np

with open('out-sorted.txt') as f:
        data = map(int, f)
f.close()

MIN = min(data)
MAX = max(data)
BINS = 200

n, bins, patches = plt.hist(data, bins = 10 ** 
np.linspace(np.log10(MIN), np.log10(MAX), BINS))
plt.gca().set_xscale("log")
plt.xlabel('latency (ms)')
plt.ylabel('number of occurences')
plt.show()
#############################

This is the result:

http://i.imgur.com/e4hb3Tw.png

The problem is, this is an aggregate of values over a large time 
interval. I would like to add another dimension to the histogram - 
timestamp, showing how this histogram varies in time. The frequency 
shall remain on the vertical axis; timestamp and the actual value shall 
be the 2 horizontal axes.

I could generate another data file, with each value prefixed with a 
timestamp in the format %Y-%m-%d-%H-00-00 (already truncated to the hour).

For all values sharing the same timestamp, I want to do a histogram, and 
then repeat the process on the timestamp axis. The value axis must be 
logarithmic, just like in the example shown above.

Any ideas? I'm new to Matplotlib and I'm not sure where to begin.

-- 
Florin Andrei
http://florin.myip.org/

------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&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