Re: How to get picture ? (fwd)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 11 1999 - 10:15:08 MET


Sanjeev U. Pandey wrote:
> 
>  Hi,
> 
>  This is a followup on the message Valery sent out on my behalf yesterday.
>  I tried to follow the suggestion to add the line
> 
>  gStyle->SetFrameFillColor(0);
> 
>  but still have the same problem. The first time I run the macro I get no
>  picture but the second time I do. I enclose the macro I use below. I
>  believe Valary copied the root file I used to an area where you can
>  access it if you need to duplicate this problem.
>        hpbrun:~fine/root/pasa_20ns_vel65_noise1mv.root
>  I am also a bit confused about the above command as it does not appear in the
>  tutorials in the  root home page.
> 

Hi Sanjeev,
Color 0 is the default case for SetFrameFillColor. The drawing routines
will force the frame color to be the pad color in this case.
To force a given color for the frame (eg 21), do:
   gStyle->SetFrameFillColor(21);

Rene Brun



>  Regards,
> 
>  Sanjeev Pandey
>  sanjeev@bnl.gov
> 
> *************************
> 
> {
> 
>     gROOT->Reset();
>     gStyle->SetFrameFillColor(0);
> 
>     //c1 = new TCanvas("c1","Amp vs Width",200,10,700,500);
> 
>     //c1->SetFillColor(42);
>     //c1->GetFrame()->SetFillColor(21);
>     //c1->GetFrame()->SetBorderSize(6);
>     //c1->GetFrame()->SetBorderMode(-1);
> 
>     TH2F *amp_wid = new TH2F("amp_wid","Amplitude vs Width",100,100,800,100,30,220);
>     amp_wid->Draw();
> 
>     TFile n40ns_1mv("pasa_40ns_vel65_noise1mv.root");
> 
>     c1.cd();
> 
>     ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>3600&&i_a*sqrt(i_s)<3700","same");
> 
>     c1->Modified();
>     c1->Update();
> 
> }
> **************************************************
> 
> ---------- Forwarded message ----------
> Date: Fri, 08 Jan 1999 16:24:37 +0100
> From: Rene Brun <Rene.Brun@cern.ch>
> To: fine@mail.cern.ch
> Cc: rootdev@hpsalo.cern.ch
> Subject: Re: How to get picture ?
> Resent-Date: Fri, 8 Jan 1999 13:06:39 -0500
> Resent-From: "Valery Fine" <fine@bnl.gov>
> Resent-To: sanjeev@bnl.gov
> 
> Valery Fine wrote:
> >
> >   Hello team,
> >
> >   Could some one explain me and my user why the macro below shows no
> > picture been launched from the scratch bit does it just one calls it
> > twice:
> > (find file hpbrun:~fine/root/pasa_20ns_vel65_noise1mv.root to reproduce result)
> >
> 
> Hi Valery,
> Easy to explain. The first time, no TFrame object exists. A TFrame
> objects is created by functions such as TH1::Paint or TTree::Draw.
> You should use the function in TStyle
> 
>   gStyle->SetFrameFillColor(); etc
> 
> Rene
> 
> > {
> >    //
> >    // To see the output of this macro, click begin_html <a href="gif/h1draw.gif">here</a> end_html
> >    //
> >     gROOT->Reset();
> >
> >  //c1 = new TCanvas("c1","Amp vs Width",200,10,700,500);
> >
> >  //c1->SetFillColor(42);
> >  //c1->GetFrame()->SetFillColor(21);
> >  //c1->GetFrame()->SetBorderSize(6);
> >  //c1->GetFrame()->SetBorderMode(-1);
> >
> >     TH2F *amp_wid = new TH2F("amp_wid","Amplitude vs Width",100,100,800,100,30,220);
> >  amp_wid->Draw();
> >
> >  TFile n20ns_1mv("pasa_20ns_vel65_noise1mv.root");
> >  //TFile n20ns_4mv("pasa_20ns_vel65_noise4mv.root");
> >  //TFile n40ns_4mv("pasa_40ns_vel65.root");
> >  //TFile n40ns_1mv("pasa_40ns_vel65_noise1mv.root");
> >         //TFile n60ns_4mv("pasa_60ns_vel53.root");
> >  //TFile n60ns_4mv_1("pasa_60ns_vel53_1.root");
> >
> >  // n20ns_1mv.cd();
> >
> >  c1.cd();
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>400&&i_a*sqrt(i_s)<500","same");
> >         ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>800&&i_a*sqrt(i_s)<900","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>1200&&i_a*sqrt(i_s)<1300","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>1600&&i_a*sqrt(i_s)<1700","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>2000&&i_a*sqrt(i_s)<2100","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>2400&&i_a*sqrt(i_s)<2500","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>2800&&i_a*sqrt(i_s)<2900","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>3200&&i_a*sqrt(i_s)<3300","same");
> >  ntp2->Draw("i_a:i_s","i_a*sqrt(i_s)>3600&&i_a*sqrt(i_s)<3700","same");
> >
> >  c1->Modified();
> >  c1->Update();
> >
> > }
> >
> > =================================================================
> > Dr. Valeri Faine (Fine)
> >     -------------------          Phone: +1 516 344 7806
> > Brookhaven National Laboratory   FAX  : +1 516 344 4206
> > Bldg. 510A /STAR                 mailto:fine@bnl.gov
> > Upton, New York, 11973-5000      http://nicewww.cern.ch/~fine
> > USA
> >
> > Dr. Valery Fine                  Telex : 911621 dubna su
> >     -----------
> > LCTA/Joint Inst.for Nuclear Res. Phone : +7 09621 6 40 80
> > 141980 Dubna, Moscow region      Fax   : +7 09621 6 51 45
> > Russia                           mailto:fine@main1.jinr.dubna.su



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET