Hi all!
I would like to change the size of the label on the vtkScalarBarActor.
The label size is too big, so I tried to change as below:
vtkNew m_vtkScalarBar;
m_vtkScalarBar->GetLabelTextProperty()->SetFontSize(100);
But it is not effective.
How to change the size of the label?
Thank you
Hi, Kim,
What do you get if you do m_vtkScalarBar->GetLabelTextProperty()->SetFontSize(1);
?
cheers,
Paulo
Hi Paulo Carvalho.
There are the same.
My code is:
vtkNew m_vtkScalarBar;
m_vtkScalarBar->SetLookupTable(lut);
m_vtkScalarBar->SetNumberOfLabels(6);
m_vtkScalarBar->SetBarRatio(0.1);
m_vtkScalarBar->SetHeight(0.3);
m_vtkScalarBar->SetTextPad(10);
m_vtkScalarBar->SetTextPositionToPrecedeScalarBar();
m_vtkScalarBar->GetLabelTextProperty()->SetFontSize(50);
Hello, Kim,
You can try ParaView’s custom scalar bar. Here is a derived class from it: https://github.com/PauloCarvalhoRJ/gammaray/tree/AutoVarFit_improvements/imagejockey/paraviewscalarbar . The header that defines the class is vtkParaViewScalarBar.h
. It is still in a branch, but in the near future it will be merged into master
.
cheers,
Paulo