Re: SetLabelSize on Graphs BEFORE Draw() ?

Rene Brun (Rene.Brun@cern.ch)
Mon, 05 Jan 1998 16:31:45 +0100


Dirk Meier wrote:

> Hello,
>
> how can I change the label and value size of
> a graph BEFORE I drawing it?
>
> I did:
>
> {
> gROOT->Reset();
> gStyle->SetLabelSize(0.08,"X");
> gROOT->ForceStyle(); // has no effect on default
> // it is still 0.04 (default)
>
> TCanvas* cA = new TCanvas("cA","Tracking, Plane Performance
> Display",0,0,1200,600);
>
> cA->UseCurrentStyle(); // no effect on x-valueorlabelsize
>
> Int_t n = 3; Float_t x[n]; Float_t y[n]; for (Int_t i=0;i<n;i++)
> {x[i]=i;y[i]=3*i;}
>
> TGraph* g = new TGraph(n,x,y);
>
> g->Draw("AL");
>
> /*
> cA->UseCurrentStyle();
> cA->Modified();
> cA->Update(); // value size still at 0.04
>
> g->UseCurrentStyle();
> cA->Modified();
> cA->Update(); // value size still at 0.04
>
> g->GetHistogram()->GetXaxis()->UseCurrentStyle(); // value size still at
> 0.04
>
> cA->Update();
> //g->GetHistogram()->GetXaxis()->SetLabelSize(gStyle->GetLabelSize()); //
> now value size changed to 0.08
> */
>
> cA->Update();
> g->GetXaxis()->SetLabelSize(gStyle->GetLabelSize()); // now value size
> changed to 0.08, but only afterwards ...
>
> }

This feature was not implemented. I have added it in the development
version.

Rene Brun