I have two columns of data, x(angle) and y(distance), they are my experiment results(figure 1). How can I use these results to make a ‘hotmap diagram’ by matlab? The z axis is the density value of xy dots in the 2D coordinate department, like below figure2. Thank you!
closed as off-topic by Nathan Reed, Christian Rau, trichoplax♦ Nov 16 '17 at 21:50
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about creating artwork or using graphics software as an end-user are off-topic for this site. Consider if your question might be re-written to fit on Graphic Design. If your question is about Blender, it might fit on Blender." – Nathan Reed, Christian Rau, trichoplax
You basically need to plot the scatter map with varying colors for each point
scatter(x, y, , c);
The main difficulty is to calculate
c so that it’s proportional to the density.
To do so you can divide the map into a grid of a certain resolution, say
[res_x, res_y]. Then count for each grid cell how many points are there. This count is an approximation of the density at that grid cell. Finally you can assign to all points within this grid cell the
c value equal this count.
Probably you also need to normalize