Re: TBox

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 20 Jun 2007 07:48:30 +0200


You must draw the graph before the box. When specifying the draw option "A" the pad is cleared.

Rene Brun

Monika Sharma wrote:
>
> Hi Rooters,
>
> I have been trying to draw the errors as a box but some
> how it doesn't draw the box. I am pasting my macro below,
>
> Thanks for any help.
>
> Regards
> Monika
>
> void roots1()
> {
>
> gROOT->Reset();
> TCanvas *c1 = new TCanvas("c1","Nu-dynamic for CuCu
> 200",600,600,600,600);
> c1->SetBorderMode(0);
> c1->SetFillColor(kWhite);
> TMultiGraph *mg = new TMultiGraph();
>
> Int_t n = 3;
> Double_t xCERES[] = {8, 13, 18};
> Double_t yCERES[] = {-0.00006, -0.00069, -0.00108};
> Double_t exCERES[] = {0,0,0};
> Double_t eyCERES[] = {0.00005, 0.00005, 0.00005};
> gr1 = new TGraphErrors(n,xCERES,yCERES,exCERES,eyCERES);
> gr1->SetMarkerColor(9);
> gr1->SetMarkerStyle(20);
> gr1->SetMarkerSize(1.4);
> mg->Add(gr1);
>
> TBox *box = new TBox(13, -0.0004, 14, -0.00007);
> box->SetLineColor(kBlack);
> box->SetLineColor(kBlack);
> box->SetLineWidth(2);
> box->SetFillStyle(0);
> box->Draw();
>
> mg->Draw("A.P");
>
>
> }
Received on Wed Jun 20 2007 - 07:48:39 CEST

This archive was generated by hypermail 2.2.0 : Wed Jun 20 2007 - 11:50:02 CEST