Path: blob/master/activities/histogram2d-example.ipynb
934 views
Kernel: Unknown Kernel
Example of 2D-Histograms
For this example, we are going to make a 2D histogram of a randomly generated data of some human population, comprising age and height. For this we are going to use the random module of the library NumPy.
In [1]:
Out[1]:
Populating the interactive namespace from numpy and matplotlib
Let's assume a set of 50 entries with 3 values each one. The first one is an age, the second one is a height and the thrid one is the number of people who meet the first two conditions.
In [44]:
The objetive now is to make a 2D histogram of age vs height. The function histogram2d allows to use different bins in each axis.
In [45]:
In [46]:
Out[46]:
<matplotlib.text.Text at 0x7fac9b9b7590>