# vtk dataset plotting is not working as expected.

**URL:** <https://discourse.vtk.org/t/vtk-dataset-plotting-is-not-working-as-expected/12353>\
**Category:** Development\
**Tags:** python, code\
**Created:** [September 24, 2023, 10:45am UTC](https://discourse.vtk.org/t/vtk-dataset-plotting-is-not-working-as-expected/12353 "2023-09-24T10:45:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samjoe](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@Samjoe](https://discourse.vtk.org/u/Samjoe)\
**Post date:** [September 24, 2023, 10:45am UTC](https://discourse.vtk.org/t/vtk-dataset-plotting-is-not-working-as-expected/12353/1 "2023-09-24T10:45:38Z")

</div>

Hello,  
I have created a vtk viewer to view FEA results . But some plots are not showing as they should be. If I load the vtk file in paraview it plots correctly but not in my viewer.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8a0e8f5f2c3a274e1d49bbaab50d7e744d7e9cb7.png)

 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/3eda68fc3de92c429474e2287a4bfc630bf65331.png)

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/44e197d42280016c620e5530ccfa61b1d9a59cf6.png)

The equivalent stress plot is correctly plotted but some plots are not matching.  
I have set up my code as below

ArrName = self.pvtkPDataArray.GetPointData().GetArrayName(ArrId)  
dataRange = self.pvtkPDataArray.GetPointData().GetScalars(ArrName).GetRange(CompId)

pvtkDataSetMapper = vtk.vtkDataSetMapper()  
pvtkDataSetMapper.SetInputData(self.pvtkPDataArray)  
pvtkDataSetMapper.SetScalarModeToUsePointFieldData()  
pvtkDataSetMapper.SetInterpolateScalarsBeforeMapping(1)  
pvtkDataSetMapper.SetArrayId(ArrId)  
pvtkDataSetMapper.SetArrayComponent(CompId)  
pvtkDataSetMapper.SetScalarRange(dataRange)

self.SetLookUpTable(dataRange)  
pvtkDataSetMapper.SetLookupTable(self.pLookUpTable)  
pvtkDataSetMapper.Update()

pvtkActor3D = vtk.vtkActor()  
pvtkActor3D.SetMapper(pvtkDataSetMapper)

Please can someone review this and point out where is the mistake. It would be very helpfull

Thankyou and Best Regards  
Sam
