This was an old problem from a year ago...<br>Original email from Sarah Macumber here: <a href="http://markmail.org/message/43xy5lak7voswcoo">http://markmail.org/message/43xy5lak7voswcoo</a><br><br><br>I had this problem recently, and could not figure out what was wrong with my code. No matter how much I changed the vtkScalarActor's width, height, position, the vtkScalarBarWidget would always display in the same area and with the same size (incorrectly, of course!).<br>
<br>The solution was that the actual setting for the vtkScalarBarWidget was from vtkScalarBarRepresentation. To change the position, I ended up doing<br><br> vtkScalarBarRepresentation *rep = vtkScalarBarRepresentation::SafeDownCast(ScalarBarWidget->GetRepresentation());<br>
<br> rep->SetPosition(.85, .65);<br> rep->SetPosition2(.10, .35);<br><br>(the safedowncast might not be necessary). SetPosition2 sets the height/width of the actual widget on the renderer relative to SetPosition.<br>
<br>Took me a while to figure it out, and wanted to put this out there in case others were confused or end up googling this issue.<br><br><div id="body" class="messagebody"><div class="pws"><p>"Hi,
</p><p>
I have been having problems with the <strong>vtkScalarBarWidget</strong> which seems to resize<br>itself when On( ) is called. Even though my scalarBarActor has a fixed width,<br>height and posisiton none of that translates and my scalar bar shows up looking<br>
like a square at the bottom right of my screen. Any help would be appreciated.
</p><p>Thanks,
Sarah
</p><p>_scalarBarActor.SetPosition(.1, .1);
</p><p>_scalarBarActor.SetOrientationToHorizontal();
</p><p>_scalarBarActor.SetWidth(.8);
</p><p>_scalarBarActor.SetHeight(0.17);
</p><p>_scalarBarWidget.SetInteractor(ren.GetRenderWindow().GetInteractor());
</p><p>_scalarBarWidget.SetCurrentRenderer(ren);
</p><p>_scalarBarWidget.CreateDefaultRepresentation();
</p><p>_scalarBarWidget.SetScalarBarActor(_scalarBarActor);
</p><p>_scalarBarWidget.On();"</p></div></div><br><br>