Re: strange behaviour of axes label fonts for TH2F

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Thu, 21 Apr 2011 12:44:31 +0000


Have you tried gROOT->ForceStyle() ?

On 4/21/11 2:04 PM, "Pietro Govoni" <Pietro.Govoni_at_mib.infn.it> wrote:

>Dear Rooters,
>
>it seems that building a TH2F forces the labels of its axes to keep the
>gStyle properties at the creation time.
>On my Mac, with root 5.27.02, if I run:
>
>gStyle->SetLabelFont (42,"xyz") ;
>TH2F test ("test", "test", 10, 0, 10, 10, 0, 10) ;
>TCanvas c1 ;
>test.Draw () ;
>
>I get the plot with the label font 42, while if I switch the first two
>lines as follows:
>
>TH2F test ("test", "test", 10, 0, 10, 10, 0, 10) ;
>gStyle->SetLabelFont (42,"xyz") ;
>TCanvas c1 ;
>test.Draw () ;
>
>I get the labels written with the default font.
>This does not happen with TH1F objects.
>Is there a way to change the fonts after the histo is created? (trivial
>use case: a code saves the histo, another code makes the nice plotting)
>
>Best regards,
>
>pietro
Received on Thu Apr 21 2011 - 14:44:37 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 21 2011 - 17:50:02 CEST