I have a .txt file containing the x,y values of regularly spaced points in a 2D map, the 3rd coordinate being the density at that point.
4.882812500000000E-0
The comment from @HYRY is good, but a complete minimal working answer (with a picture!) is better. Using plt.pcolormesh
import pylab as plt
import numpy as np
# Sample data
side = np.linspace(-2,2,15)
X,Y = np.meshgrid(side,side)
Z = np.exp(-((X-1)**2+Y**2))
# Plot the density map using nearest-neighbor interpolation
plt.pcolormesh(X,Y,Z)
plt.show()

If the data looks like your sample, numpy can load it using the command numpy.genfromtext.