To make a density map from a 2D set of data, the first step is to compute values for the third dimension. (Gnuplot has no facilities for computing these values automatically.) The simplest way is to make a 2D histogram; the plot is divided in small 2D regions, and the z-values are proportional to the number of points inside these regions. The following Python script will make an histogram from a time series of two dihedral angles.
M. Ester, H. Kriegel, J. Sander, and X. Xu. Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD-96), page 226-231. AAAI Press, (1996)