# Thread: Bin size for 3d histogram

1. ## Bin size for 3d histogram

I know there exist rules to calculate for the minimum bin size for 2d histograms.
However, I would like to calculate the minimum bin size for a 3d histogram.

I have a lot of data of home-work trips made in the past. (>10000) For every trip I have information about the trip length, the travel-time ratio between car and bicycle, and the chosen travel mode. (car or bicycle) Based on the trip length and the travel time ratio I want to calculate the percentage bicycle use.
I have a table with on the x-axis the travel-time ratio between car and bicycle. On the y-axis I have the distance of a trip from home. In every cell the percentage bicycle use is
My question is know: how to choose the bin size for both travel time ratio and trip length?

An example of the table: (with 4x5=20 bins)
Code:
0.8-1.0  1.0-1.2  1.2-1.4  1.4-1.6 (<-- travel time ratio)
0 - 2 km          55%      54%      45%      35%
2 - 4 km          46%      41%      39%      27%
4 - 6 km          34%      34%      22%      24%
6 - 8 km          35%      21%      19%      19%
>8 km          11%      9%        5%       5%

2. Originally Posted by daan024
I know there exist rules to calculate for the minimum bin size for 2d histograms.
However, I would like to calculate the minimum bin size for a 3d histogram.

I have a lot of data of home-work trips made in the past. (>10000) For every trip I have information about the trip length, the travel-time ratio between car and bicycle, and the chosen travel mode. (car or bicycle) Based on the trip length and the travel time ratio I want to calculate the percentage bicycle use.
I have a table with on the x-axis the travel-time ratio between car and bicycle. On the y-axis I have the distance of a trip from home. In every cell the percentage bicycle use is
My question is know: how to choose the bin size for both travel time ratio and trip length?

An example of the table: (with 4x5=20 bins)
Code:
0.8-1.0  1.0-1.2  1.2-1.4  1.4-1.6 (<-- travel time ratio)
0 - 2 km          55%      54%      45%      35%
2 - 4 km          46%      41%      39%      27%
4 - 6 km          34%      34%      22%      24%
6 - 8 km          35%      21%      19%      19%
>8 km          11%      9%        5%       5%

This kind of tabulation/plot is not a histogram (and so the histogram bin number rules would not apply even for a normal bar chart type plot).

CB