Hi Dugan,
I cannot reproduce your problem with TLegend.
Could you send a simple but working macro reproducing this problem ?
Note that you can simplify your program in two ways.
- Instead of:
const Int_t m=2;
Float_t x1[m],z[m];
x[0]=0.0;
x[1]=20.0;
y[0]=0.75;
y[1]=1.1;
TGraph *g = new TGraph(m,x,y);
g->SetTitle("Efficiency vs.Threshold for CEM(1,x) CJT(2,7 or 10)");
you can do (assuming a TCanvas already craeted)
gPad->drawFrame(0,0.75,20,1.1);
or/and
use a TMultiGraph object.
Rene Brun
oneil@fnal.gov wrote:
>
> Hi,
>
> I am trying to overlay a bunch of graphs, so I make a dumb one to start
> with y-axis range from 0.75 to 1.1
>
> const Int_t m=2;
> Float_t x1[m],z[m];
>
> x[0]=0.0;
> x[1]=20.0;
> y[0]=0.75;
> y[1]=1.1;
> TGraph *g = new TGraph(m,x,y);
> g->SetTitle("Efficiency vs.Threshold for CEM(1,x) CJT(2,7 or 10)");
>
> Then I create a bunch of other graphs with stuff in them
>
> TGraph *gr1 = new TGraph(n,x,y1);
> TGraph *gr2 = new TGraph(n,x,y2);
> etc.
>
> Then I draw my dumb graphs and create a legend
>
> g->Draw("AP");
> gr1->Draw("P");
> etc.
>
> leg = new TLegend(0.6,0.6,0.9,0.9);
> leg->AddEntry(g,"CJT(2,7)","l");
> leg->AddEntry(gr1,"CJT(2,7)","l");
> leg->SetHeader("Thresholds");
>
> Then draw it.
>
> leg->Draw();
>
> The problem is that the font in the legend comes out really small. It
> seems intimately connected to the y-range of the axis. If I make the range
> 0-1 it works great. The problem seems to occur when I make the lower
> bound non-zero....I get linear shrinkage as I approach the upper bound.
> Any ideas? It is as if it is not using NDC anymore....
>
> I am using ROOT v3.01/06.
>
> Thanks,
> Dugan.
> ----------------------------------------------------------------------------
> Dugan O'Neil E-mail : oneil@fnal.gov
> Dugan.O'Neil@cern.ch
> Dept. of Physics and Astronomy web : http://www-d0.fnal.gov/~oneil
> Michigan State University
>
> phone:(630)840-2829 It's too bad that whole families
> fax :(630)840-8886 have to be torn apart by something
> as simple as wild dogs.
> - Jack Handey
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Mail: Couriers:
> MS 352 Kirk and Wilson Streets
> Fermilab Mail Station 352
> P.O.Box 500 Fermilab
> Batavia, IL 60510-0500 Batavia, IL 60510-0500
> ----------------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:05 MET