Re: [ROOT] Pads drawn on myCanvas, but points not drawn on TPad ...

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Nov 17 2003 - 08:30:18 MET


Hi Zaldy,

zaldy wrote:
> 
> Dear ROOT Talk,
> 
> What is wrong with the codes below?
> 
> I have all the declarations at the header file "file.hh".
> If I use B line the points of TGraph are drawn on the Canvas. But if I use
> the A lines, the pads are drawn but the points are not drawn. I know the
> current pads from line C.

It is hard to understand what you are trying to do. What is myCan? your main
canvas?
What is MainPad? a pad inside myCan?
What do you mean by "the points are not drawn" ? which points?

> 
> I though that if we invoke myPad_in_the_canvas->cd();
> Then the Pad objects owns the the TGraph points, so the points should
> appear in the pads.

calling TPad::cd has nothing to do with the ownership.

I suggest that you send a complete macro showing what you are trying to do.

Rene Brun

> 
> Is there like a function under TGraph like
>      TGraph * myGraph  = new ....
>      myGraph->SetNDC(); /////this is similar in TText;
> 
> 
> Any idea?
> Thank you ....
> 
> root 3.04/02
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> --------------------------
> ...................
> ..................
>     B       myCan->cd();
> 
>     A       currentPad = (TPad *)MainPad->GetPad(11);
>     A       currentPad->cd();
>     A       currentPad->Clear();
> 
>     C       cout <<"Current Pad: "<< gPad->GetName()<< endl;
>            Top_hit = new TGraph(n_hit_top, tophit_layer, tophit_strip);
>            Top_hit->SetMaximum(120);
>            Top_hit->SetMinimum(-2);
>            Top_hit->Draw("ap");
> 
> --
> 
> --------------------------------------------------------
>                    Zaldy A. Nawang
>                    PS Users Room 2
>                    Yon Gokan,
>                    E362, Neutrino Group,
>                    IPNS, KEK,
>                    Japan
> 
>                    e-mail: zaldy@neutrino.kek.jp
>                    Tel. No. : (81) 029864 - 5387
> --------------------------------------------------------



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET