This is more of a general question about 3d histogram creation in python.
I have attempted to create a 3d histogram using the X and Y arrays in the following code>
In this answer there is a solution for 2D and 3D Histograms of scattered points. The usage is simple:
points, sub = hist2d_scatter( radius, density, bins=4 )
points, sub = hist3d_scatter( temperature, density, radius, bins=4 )
Where sub is a matplotlib "Subplot" instance (3D or not) and pointscontains the points used for the scatter plot.