# Visualize Field data python

**URL:** https://discourse.vtk.org/t/visualize-field-data-python/8066
**Category:** Support
**Tags:** python
**Created:** [March 16, 2022, 8:24am UTC](https://discourse.vtk.org/t/visualize-field-data-python/8066 "2022-03-16T08:24:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![imomnipresent](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/i/7993a0/32.png) [@imomnipresent](https://discourse.vtk.org/u/imomnipresent)
#### Post date: [March 16, 2022, 8:24am UTC](https://discourse.vtk.org/t/visualize-field-data-python/8066/1 "2022-03-16T08:24:41Z")

</div>

I would like to visualize the displacement field data on my unstructured grid created using vtkPoints() in python. I have the displacement field data at each point. How can i create a vtu file with all these data (point data and field data) and visualize the results in paraview? Here’s the relevant part of the code:

```auto
# surf, point_array,points_traction,points_disp,X_sample_G,X_sample_u,X_sample_t = make_cube()
    # colloc_points = point_array
    # new_points = point_array
    colloc_points = genfromtxt('colloc_points-u30.csv', delimiter=',')
    displacement = genfromtxt("displacement-u30.csv", delimiter=',')
    new_points = colloc_points+displacement
    colors = vtkNamedColors()

    # create polyhedron (cube)
    # The point Ids are: [0, 1, 2, 3, 4, 5, 6, 7]
    points1 = vtkPoints()
    points2 = vtkPoints()

    for i in range(colloc_points.shape[0]):
        points1.InsertNextPoint(colloc_points[i])
    for i in range(new_points.shape[0]):
        points2.InsertNextPoint(new_points[i])

    ugrid1 = vtkUnstructuredGrid()
    ugrid1.SetPoints(points1)
    ugrid2 = vtkUnstructuredGrid()
    ugrid2.SetPoints(points2)

    # ugrid.InsertNextCell(VTK_POLYHEDRON, faceId)

    # Here we write out the cube.
    writer1 = vtkXMLUnstructuredGridWriter()
    writer1.SetInputData(ugrid1)
    writer1.SetFileName('polyhedron1.vtu')
    writer1.SetDataModeToAscii()
    writer1.Update()

    writer2 = vtkXMLUnstructuredGridWriter()
    writer2.SetInputData(ugrid2)
    writer2.SetFileName('polyhedron2.vtu')
    writer2.SetDataModeToAscii()
    writer2.Update()

```
