[vtkusers] Re: How to set font size in vtkScalarBarActor?

Theodore D. Sternberg tdsternberg at lbl.gov
Fri Mar 12 19:41:15 EST 2004


My mistake, it has been answered, and very well at that ;-)
http://public.kitware.com/pipermail/vtkusers/2003-February/016114.html

On Fri, 12 Mar 2004, Theodore D. Sternberg wrote:
> This question has been posed at least twice before on this mailing list, 
> but no one answered it (at least not on the mailing list): how do you take 
> control of the font size in vtkScalarBarActor?  As the little script below 
> illustrates, you can call GetLabelTextProperty().SetFontSize all you want,
> and nothing happens.  Of course the font size does change -- 
> automatically, in reponse to the user stretching the render window.  So 
> perhaps the real question is, How can I disable or override the 
> vtkScalarBarActor's automatic font rescaling mechanism?
> 
> -----------------------------------------
> import vtk
> 
> scalarBar = vtk.vtkScalarBarActor()
> scalarBar.SetLookupTable( vtk.vtkPolyDataMapper().GetLookupTable() )
> scalarBar.GetLabelTextProperty().SetFontSize(8)
> 
> ren = vtk.vtkRenderer()
> renWin = vtk.vtkRenderWindow()
> renWin.AddRenderer(ren)
> ren.AddActor(scalarBar)
> renWin.Render()
> -------------------------------------------
> 
> Ted Sternberg
> Lawrence Berkeley National Laboratory




More information about the vtkusers mailing list