[vtkusers] How to change the values on a vtkScalarBarActor?

agerlach agerlach at gmail.com
Mon Feb 7 17:51:55 EST 2011


All,

I have a set of scalars for a polydata that I would like to visualize by
different colors and then have a legend for those colors in the form of a
scalar bar. I have this working, but the labels on the scalar bar are always
between [0,1]. How do I change the labels to be between the min and max of
my scalars?

I have tried the following:

      vtkSmartPointer<vtkLookupTable> lookupTable =
vtkSmartPointer<vtkLookupTable>::New();
      lookupTable->SetTableRange(-3.5, 6);
      lookupTable->Build();

      this->polyMapper->SetLookupTable(lookupTable);

      vtkSmartPointer<vtkScalarBarActor> scalarBar =
vtkSmartPointer<vtkScalarBarActor>::New();
      scalarBar->SetLookupTable(lookupTable);

      this->renderer->AddActor2D(scalarBar);

According to some other posts that I have found, the scalarBar should use
the range set in lookupTable->SetTableRange(), but no matter what I try the
scalarBar's range is always [0,1].
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-change-the-values-on-a-vtkScalarBarActor-tp3375118p3375118.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list