# Undocumented behavior for scalar bars

**URL:** <https://discourse.vtk.org/t/undocumented-behavior-for-scalar-bars/14102>\
**Category:** Development\
**Created:** [June 21, 2024, 8:15pm UTC](https://discourse.vtk.org/t/undocumented-behavior-for-scalar-bars/14102 "2024-06-21T20:15:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)\
**Post date:** [June 21, 2024, 8:15pm UTC](https://discourse.vtk.org/t/undocumented-behavior-for-scalar-bars/14102/1 "2024-06-21T20:15:24Z")

</div>

This information is for people working with  
vtkScalarBarActor  
vtkScalarBarWidget  
vtkScalarBarRepresentation

My experiments indicate that if you want to change the orientation, then you must call  
vtkScalarBarRepresentation::SetOrientation()  
before you call  
vtkScalarBarRepresentation::SetPosition()  
vtkScalarBarRepresentation::SetPosition2()

If you set the orientation after calling SetPosition() and SetPosition2() the results look terrible.
