A weighted 1D histogram seems pretty straight-forward. How can I implement a 2D weighted histogram given a weights-vector, w?
MATLAB:
x = randn(4,1); //some random x input
y = randn(4,1); //some random y input
w = [10, 20, 30, 40]; //weight to be assigned to corresponding data point in the generated histogram, i.e. the pixel intensity value
figure;
H = histogram2(x,y); //Matlab built-in 2D histogram
How should I use w in the above code snippet to get a weighted 2D histogram function.
*MATLAB code is preferred, but may also accept Python.
