I think that this question may help you
https://fenicsproject.org/qa/2878/visualising-shape-functions
Sample code adapted from the accepted answer
from dolfin import *
mesh = UnitSquareMesh(10,10)
plot(mesh)
V = FunctionSpace(mesh, 'CG', 2)
v = Function(V)
v.vector()[51] = 1
mesh2 = UnitSquareMesh(100,100)
V2 = FunctionSpace(mesh2, 'CG', 2)
v2 = project(v.dx(0).dx(0), V2)
plot(v2)
interactive()