Display point coordinates in Paraview

Here is how to display point coordinates in Paraview. First create a programmable filter with the following code:

pdi = self.GetInput()
pdo = self.GetOutput()
coords = vtk.vtkDoubleArray()
coords.SetName("Coordinates")
coords.SetNumberOfComponents(3)
n = pdi.GetNumberOfPoints()
for i in xrange(n):
   p=pdi.GetPoint(i)
   coords.InsertNextTuple3(p[0], p[1], p[2])
pdo.GetPointData().AddArray(coords)

Then select points and enable point labels in the Selection inspector:

#paraview, #python