# How to change the size of the label on the vtkScalarBarActor?

**URL:** https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532
**Category:** Support
**Created:** [June 12, 2020, 9:43am UTC](https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532 "2020-06-12T09:43:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [June 12, 2020, 9:43am UTC](https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532/1 "2020-06-12T09:43:46Z")

</div>

Hi all!

I would like to change the size of the label on the vtkScalarBarActor.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8917fa80c970f1d920750bbd076294574d9fd4d1.png)

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 🙂

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 13, 2020, 3:24pm UTC](https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532/2 "2020-06-13T15:24:03Z")

</div>

Hi, Kim,

What do you get if you do `m_vtkScalarBar->GetLabelTextProperty()->SetFontSize(1);`?

cheers,

Paulo

---

<div class="post-metadata">

### Author: ![Kim\_William](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kim_william/32/373_2.png) [@Kim\_William](https://discourse.vtk.org/u/Kim_William)
#### Post date: [July 27, 2020, 3:06am UTC](https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532/3 "2020-07-27T03:06:40Z")

</div>

Hi Paulo Carvalho.

There are the same.

 ![그림1](https://discourse.vtk.org/uploads/default/original/2X/d/debd0fd7291814251133181121d1d2da7d9866c7.png)

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);

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 27, 2020, 1:38pm UTC](https://discourse.vtk.org/t/how-to-change-the-size-of-the-label-on-the-vtkscalarbaractor/3532/4 "2020-07-27T13:38:16Z")

</div>

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](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
