[vtkusers] Change scalarbar labels
Cory Quammen
cory.quammen at kitware.com
Wed Jul 15 09:51:31 EDT 2015
Jan,
Unless you can figure out the printf formatting string that gives you what
you want, you'll need to use annotations instead of the labels. You can set
annotated values with vtkScalarsToColors::SetAnnotation(vtkVariant,
vtkStdString), e.g.
lookupTable->SetAnnotation(0.0, "0");
lookupTable->SetAnnotation(0.2, "200e-03");
etc.
Then you'll need to display the annotations with
vtkScalarBarActor::SetDrawAnnotations(1);
Hope that helps,
Cory
On Mon, Jul 13, 2015 at 5:31 AM, Jan <liuyanbc157 at gmail.com> wrote:
> Hallo, everyone,
>
> Now I want to set new strings in position of scalarbar labels.
> For example, the range of value is 0 - 1, and with numberofLabels(6). But I
> want the display instead of 0 0.2 0.4 0.6 0.8 1.0 but with form of 0
> 200e-03
> 400e-03 600e-03 800e -03 1.0. The Problem is that FormatofLabels doesn't
> help
> support these strings. So what could I do perhaps with
> AllocateAndSizeLabels() in ScalarbarActor or with other methods to change
> the
> format of nummers in this way?
>
> Thanks alot.
>
> Jan
>
> _______________________________________________
> 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/20150715/439e11fc/attachment.html>
More information about the vtkusers
mailing list