Make a method to compute the population size in intervals of x, y, and time from a tree sequence. It should take a tree sequence, bins in the x and y directions, and bins in time and return an easy to plot 3-d array of the number of individuals alive in each x and y bin averaged across the times in each time bin.
If x_bins, y_bins, or time_bins is a single number, the breakpoints will be np.linspace(0, max(x), xbins + 1). If any of the bins is an array it will be the breakpoints.
Returns a 3-d array with dimensions (number of x breakpoints - 1) by (number of y breakpoints - 1) by (number of time breakpoints - 1)
The goal is to make it easy to make plots like this:
Make a method to compute the population size in intervals of x, y, and time from a tree sequence. It should take a tree sequence, bins in the x and y directions, and bins in time and return an easy to plot 3-d array of the number of individuals alive in each x and y bin averaged across the times in each time bin.
If
x_bins
,y_bins
, ortime_bins
is a single number, the breakpoints will benp.linspace(0, max(x), xbins + 1)
. If any of the bins is an array it will be the breakpoints.Returns a 3-d array with dimensions (number of x breakpoints - 1) by (number of y breakpoints - 1) by (number of time breakpoints - 1)
The goal is to make it easy to make plots like this: