script to plot a histogram of distances to the edges