I have a list of coordinates in form {{x1,y1},{x2,y2},...}
Is there a way in mma to builds density plots based on position (
ListDensityPlot calculates density based on value in {x,y,value})? I want to create something similar to heatmap.py.
|
I have a list of coordinates in form Is there a way in mma to builds density plots based on position (
|
|||
|
|
|
There are two functions that can do this: These functions also come in a smoothed version (prepend Edit If you work in a regime where individual points are resolved, you may notice a disconcerting shift in the output of
I only noticed this after looking at R.M.'s plot with the original points superimposed, as shown above. To fix this and at the same time understand better what these smoothed histogram plots really do, you could take a look at the following function:
So I basically re-implemented this plotting function by using The options it recognizes are Besides giving better alignment between the heat map and the points, this manual approach also could be used to do some non-standard things. For example, you could change To show the dependence on the choice of radius, here is a movie:
Edit I forgot to add As an added bonus, plots created with |
||||
|
|
|
You can use SmoothDensityHistogram to generate heatmaps. This does the same as what Heike's method does, but in one line. Example:
|
|||||||||||||||||||||
|
|
It looks like SmoothKernelDistribution might do the trick. For example
|
|||
|
|