I have a list of $ (x, y) $, say {{x1, y1}, {x2, y2}, ..., {x1000, y1000}} and would like to make a density plot.

I understand that I may categorize the data into different groups first, and count the number of element in each group, then make a ListDensityPlot.

I would like to ask if there is other faster way to do it, or any built-in function can be used?

Thank you!

  • 2
    $\begingroup$ It sounds like you are talking about a histogram rather than density plot. Histogram3D should plot your list as it is (without having to gather it into counts) $\endgroup$
    – bill s
    Dec 12 '18 at 3:04
  • 5
    $\begingroup$ Try SmoothDensityHistogram. $\endgroup$ Dec 12 '18 at 3:30
  • $\begingroup$ How about showing some sample data and the desired plotting? $\endgroup$ Dec 12 '18 at 3:52
Histogram3D[Table[RandomReal[{0, 1}, {2}], {1000}]]

enter image description here

which takes $0.078$ seconds.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.