I am using matplotlib's hist2d function to make a 2d histogram of data that I have, however I am having trouble interpreting the result.

Here is the plot I have:

[![enter image description here](https://i.stack.imgur.com/35hzH.png)](https://i.stack.imgur.com/35hzH.png)

This was created using the line:

```
hist = plt.hist2d(X, Y, (160,160), norm=mpl.colors.LogNorm(vmin=1, vmax=20))

```

This returns a 2d array of (160, 160), as well as the bin edges etc.

In the plot there are bins which have a high frequency of values (yellow bins). I would like to be able to get the results of this histogram and filter out the bins that have low values, preserving the high bins. But I would expect there to be 160\*160 values, but I can only find 160 X and 160 Y values.

What I would like to do is essentially filter out the more dense data from the less dense data. If this means representing the data as a single value (a bin), then that is ok.

Am I misinterpreting the function or am I not accessing the data results correctly? I have tried with spicy also but the results seem to be in the same or similar format.