Histogram Title size

Hello,

I need to increase the size of a histogram title for readability.

What is a straightforward way of implementing this?

I am thinking of something like: Make the title width as wide as the canvas for a particular font.

Or: Break the title into two lines with a font covering the width of the canvas.

Thanks, iMi

gStyle->SetTitleH(0.1);

@couet

I tried with

gStyle->SetTitleH(0.5);

and I get the same size of letters but a lower positioning of the title within the histogram.

Why could that be?

Can you post a small reproducer ?

I tried

gStyle->SetTitleW(1.0);

This worked, it was related to the long title.

you can also change the heigh:

gStyle->SetTitleH()

The title is in box. The size of the box is defined with gStyle->SetTitleW and gStyle->SetTitleH

Do the titles of the axes also sit in boxes?

So, I set the axis title like this:

imgFull [iev]-> GetXaxis()->SetTitle(“size [mm]”);

How do I manipulate them?

No, you simply specify the text size:
https://root.cern/doc/master/classTH1.html#a10b144176bd57faf7b7fe6ec8c150556
Note the 2nd parameter (option) specifying the axis.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.