convert a scatter plot into a contour plot in matplotllib

369 views Asked by At

I have the following scatter plot where I plotted using ALPHA=0.2 This allowed me to show areas with lower populations in a lighter shade and the higher ones (due to overlay) in a darker color. I plotted this in matplotlib using 2 1D (one dimensional ) numpy arrays.

I wanted to do the following instead

enter image description here

The colous vary depending on the population, blue is low and red is high population. I know I need to bin the data and then plot it but I was wondering if there was a better way to do this in python/matplotlib?

0

There are 0 answers