# Setting scalar range in vtkPolyDataMapper - vtkLookupTable vs vtkColorTransferFunction

**URL:** <https://discourse.vtk.org/t/setting-scalar-range-in-vtkpolydatamapper-vtklookuptable-vs-vtkcolortransferfunction/11089>\
**Category:** Development\
**Tags:** python, code\
**Created:** [March 29, 2023, 9:15pm UTC](https://discourse.vtk.org/t/setting-scalar-range-in-vtkpolydatamapper-vtklookuptable-vs-vtkcolortransferfunction/11089 "2023-03-29T21:15:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishgupta79](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ashishgupta79/32/6543_2.png) [@ashishgupta79](https://discourse.vtk.org/u/ashishgupta79)\
**Post date:** [March 29, 2023, 9:15pm UTC](https://discourse.vtk.org/t/setting-scalar-range-in-vtkpolydatamapper-vtklookuptable-vs-vtkcolortransferfunction/11089/1 "2023-03-29T21:15:17Z")

</div>

Hi

I am trying to setup a poly mapper with a lookup table or a color transfer function.

If I use a lookup table, then setting the SetScalarRange is used if UseLookupTableScalrRange is False and not when UseLookupTableScalrRange is true, which is according to what the vtk documentation says.

lut= vtk.vtkLookupTable()  
mapper.SetLookupTable(lut)  
mapper.SetUseLookupTableScalarRange(true/false)  
mapper.SetScalarRange(min, max)

But instead of a lookup table, if I try to use a color transfer function, then setting the scalar range has no effect, irrespective of if the UseLookupTableScalrRange is true or false.

ctf= vtk.vtkColorTransferFunction()  
mapper.SetLookupTable(ctf)  
mapper.SetUseLookupTableScalarRangeOn(true/false)  
mapper.SetScalarRange(min, max)

What am I missing here, or is that a bug?

Thanks  
Ashish
