I have a set of X,Y data points (about 10k) that are easy to plot as a scatter plot but that I would like to represent as a heatmap.
I looked through the examples in
Make a 2-dimensional array that corresponds to the cells in your final image, called say heatmap_cells
and instantiate it as all zeroes.
Choose two scaling factors that define the difference between each array element in real units, for each dimension, say x_scale
and y_scale
. Choose these such that all your datapoints will fall within the bounds of the heatmap array.
For each raw datapoint with x_value
and y_value
:
heatmap_cells[floor(x_value/x_scale),floor(y_value/y_scale)]+=1