I have been following the code in this post to generate a density-colored scatter plot and it worked great.

enter image description here

However, when I display the colorbar it returns PDF values (because the code uses scipy.stats.gaussian_kde to calculate the density). Therefore I was wondering if there was any way to have something closer to a "histogram count" (for lack of a better word) ?

It seems very obvious to me that the lowest pdf value (dark blue) correspond to a density of a single "dot" but I would like to know for the highest pdf value in dark red. Does it means 10 dots on top of each others ? 100 ? 1000 ? .. ?

I've been trying to look if there was some formula to get that kind of count from the calculated PDF values but I must admit my mathematic skills are quite limited..

I don't need to calculate for all the ticks in the colorbar but at least for the min and max values.

Thanks for your help !

0 Answers