I have a dataset (converted to a list of lists) that has 50 records, the first column of which represents the number individuals of a species taken in a trawl, the second column the minimum depth of that trawl in m, and the third column the maximum depth of the trawl in m.
The data are as follows:
md1 = {{1, 165, 165}, {2, 274, 274}, {1, 248, 268}, {1, 219, 219}, {3, 219,
232}, {12, 249, 256}, {11, 274, 274}, {1, 274, 274}, {14, 175,
183}, {2, 274, 274}, {2, 241, 247}, {1, 219, 232}, {1, 204,
204}, {1, 183, 183}, {1, 219, 256}, {5, 113, 115}, {5, 185,
185}, {7, 16.5, 16.5}, {1, 91.4, 91.4}, {1, 122, 122}, {1, 91.4,
91.4}, {2, 115, 121}, {9, 93.9, 96.9}, {2, 93.9, 93.9}, {9, 110,
119}, {35, 174, 174}, {3, 166, 236}, {7, 170, 192}, {5, 91.4,
91.4}, {1, 85.3, 85.3}, {9, 238, 238}, {2, 125, 130}, {9, 77,
79}, {4, 95, 136}, {2, 90, 128}, {1, 95, 136}, {2, 205, 210}, {2,
205, 210}, {1, 55, 91}, {1, 252, 260}, {1, 247, 247}, {1, 110,
110}, {2, 283, 283}, {8, 160, 160}, {5, 120, 120}, {1, 16, 37}, {25,
146, 146}, {7, 139, 139}, {16, 55, 55}, {423, 65.8, 71.3}}
I can create a DistributionChart that approaches what I want as follows:
mdepthprofile =
DistributionChart[{md1[[All, 2]], md1[[All, 3]]},
ChartElementFunction -> "HistogramDensity", BarOrigin -> Top,
FrameLabel -> {Style["Pontinus n. sp.", Bold, Italic],
Style["Depth (m)", Bold]}]
However, this provides two distribution charts derived from the frequencies based on record counts from each of minimumdepth and maximumdepth columns and not the number of specimens that might be expected within a given bin assuming a uniform distribution of the specimens across the entire depth interval sampled by the trawl.
What I want instead is to create a DistributionChart with a ChartElementFunction -> "HistogramDensity", with the vertical axis the depth as above, but with the bin-sizes in 50 m intervals and with bin-count indicating how many total fish in column 1 were collected within each 50 m interval. For those trawls that have a depth range that spans a 50 m boundary, I want to divide the number of specimens (column 1) so that the frequency value represents the proportion the specimens collected in each bin, assuming a uniform distribution within the trawl. That is, if a record has a depth interval of 35-125 and with 25 specimens collected in that trawl, the 25 specimens would be split among 3 bins (0-50,51-100,100-150), so that the proportion in the first bin (0-50) being 25*(15/90), the second bin being 25*(50/90) and the third bin being 25*(25/90) (ie assuming a uniform distribution within each depth range (maxdepth-mindepth) for each record. Thus, the width of each bin in the final chart would reflect the subtotal of specimens in each bin accumulated over all trawls, with the subtotals adding to the total number of specimens collected.
How can one set up ChartDistribution so that the bin-sizes and frequencies (bar widths) are computed as described above?