Creating 3D histograms
Similar to 3D bars, we might want to create 3D histograms. They are used to easily spot correlation between three independent variables. They can be used to extract information from images where the third dimension could be the intensity of a channel in (x,y) space of the image under analysis.
In this recipe, we will learn how to create 3D histograms.
Getting ready
To recall, a histogram represents a number of occurrences of some value in a particular column (usually called "bin"). The three-dimensional histogram, then, represents a number of occurrences in a grid. This grid is rectangular, over two variables that are data in the two columns.
How to do it...
For this computation, we will:
Use NumPy because it has the function to compute a histogram of two variables.
Generate x and y from normal distributions but with different parameters to be able to distinct the correlation in the resulting histogram.
Plot the scatter plot of the same dataset to demonstrate how different...