function [x, y] = histgraph(heights, bins);

delta = bins(2) - bins(1)

number = size(heights, 2)

index = 1;

x = zeros(1,2*number+2);
y = zeros(1,2*number+2);
curr = bins(1) - delta/2;

x(1) = 0;
y(1) = curr;

for i = 1:number
  x(i*2) = heights(i);
  x(i*2+1) = heights(i);
  y(i*2) = curr;
  curr = curr + delta;
  y(i*2+1) = curr;
end

x(2*number+2) = 0;
y(2*number+2) = curr;

