# make approx monthly bins, smaller bins yield spiky curves
# needs new=True to work with oldish numpy
(hist, bin_edges) = np.histogram(dates, np.ceil(history_length/30.), new=True)
+ if len(bin_edges) < 2:
+ # protect against single data point entries by ignoring them
+ # wouldn't be able to draw a line anyway ;-)
+ continue
width = bin_edges[1] - bin_edges[0]
# think lines
ax.plot(bin_edges[:-1]+(width/2), hist / width,
if not len(sys.argv) > 1:
print 'Need output filename.'
sys.exit(1)
- if len(sys.argv) > 2:
- ymax = float(sys.argv[2])
- else:
- ymax = 13
cfg_path="/home/neurodebian/neurodebian.git/neurodebian.cfg"
cfg = SafeConfigParser()
cfg.read(cfg_path)
date = datetime.strptime(date, "%d %b %Y")
data.append((ip.strip(), loc, suite, date2num(date)))
data = np.array(data, dtype=dt)
- make_figure(data, ymax).savefig(sys.argv[1], bbox_inches='tight', dpi=60)
+ make_figure(data, ymax=18).savefig(sys.argv[1], bbox_inches='tight', dpi=60)