[vtkusers] vtkScalarBar with non linear labels

Cory Quammen cory.quammen at kitware.com
Fri Aug 14 13:15:54 EDT 2015


Drak,

To add arbitrary labels, you can use the annotations mechanism.

See, for example,
http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/Annotation/Testing/Cxx/TestScalarBar.cxx

Best,
Cory

On Fri, Aug 14, 2015 at 11:57 AM, Drak <draktharrblorf at gmail.com> wrote:

>
>
> Is there any way to get the scalar bar to not automatically set my labels
> to
> a linear value?
>
> I would like to access the labels table and change myself the value so it
> follows my own formula.
>
> // scalar bar
> _hueLut = vtkLookupTable::New();
> _hueLut->SetNumberOfTableValues(100);
> _hueLut->SetTableRange(0, 100);
> _hueLut->SetTableValue(0, 0, 0, 1);
> _hueLut->SetTableValue(1, 0, 1, 0);
> //etc...
> _hueLut->Build();
>
>
> _scalarBar = vtkScalarBarActor::New();
> _scalarBar->SetLookupTable(_hueLut);
> _scalarBar->SetTitle("logarithm scalar bar");
> _scalarBar->SetNumberOfLabels(5);
> _scalarBar->SetLabelFormat("%5.4g");
>
> The problem is that my scalar bar labels seems to show the value 0, 25, 50,
> 75 and 100. I want to be able to change the labels value. For example: 0,
> 10, 25, 50, 100.
>
> Thank you.
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/vtkScalarBar-with-non-linear-labels-tp5733498.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150814/dc7450d4/attachment.html>


More information about the vtkusers mailing list