2D density plot - taoualiw/My-Knowledge-Base GitHub Wiki

2D Density Plot

Properties

  • It shows the distribution of values in a data set across the range of two quantitative variables.
  • It is useful to avoid over plotting in a scatterplot. If you have too many dots, the 2D density plot counts the number of observations within a particular area of the 2D space. This specific area can be a square or a hexagon (hexbin). You can also estimate a 2D kernel density estimation and represent it with contours

Example:

Python code for the example:

https://github.com/taoualiw/Data-Science-Basics/blob/master/Data-Visualization/04-16-2019-2D-density-plot-wt.ipynb

Good Reference for Python 2D Density Plots :

⚠️ **GitHub.com Fallback** ⚠️