Re: [ROOT] TMultiGraph ...

From: zaldy (zaldy@neutrino.kek.jp)
Date: Sat Aug 16 2003 - 11:30:37 MEST


Hi,
   

Thanks for reminding. It was a clerical error while am typing it in 
roottalk.

I re-submit again. I rechecked again my original code
Am using the notation "->" not the "." notation.
I used ROOT 3.05/05 gcc 3.3.3 Redhat 9.0

///////////////////////////////////////////////////////////
> >Why is the ff. always givves a "illegal pointer" message?
> >
> >   TMultiGraph * mg =  new TMultiGraph();
> >   TGraph * G[100];
> >   .....
> >   for (int i ....) {
> >     mg->Add(G[i]);
> >   }
> >
> >   mg->Draw("ap");
> >   mg->GetXaxis()->SetTitle("TIiiii");
> >   gPad->Modified();
> >
> >                        
> >
> >I wanted to put an X label as well as Y Label.
> >
> >I tried, TAxis * axis = (TAxis *)mg->GetXaxis();
> >         axis->SetTitle("XTITLE");
> >
> >But illegal pointer message again.
> >
> >How ever, I can make this with TGraph.
> >Why? Isnt it true that TMultigraph is just related to TGraph?
> >Could this be a bug?
////////////////////////////////////////////////////////////////////



> 
> You must be careful with '.' and '->' operators. After *mg = new .... 
> you can use only '->' notation to resolve object methods and variables, 
> 'cause 'mg' is the pointer, not the very object. So change mg. to mg-> 
> everywhere.
> 
>                          Best regards,
>                                                                          
> Stanislav.
> 
> zaldy wrote:
> 
> >Hello,
> >
> >
> >Why is the ff. always givves a "illegal pointer" message?
> >
> >   TMultiGraph * mg =  new TMultiGraph();
> >   TGraph * G[100];
> >   .....
> >   for (int i ....) {
> >     mg.Add(G[i]); 
> >   }
> > 
> >   mg.Draw("ap");  
> >   mg->GetXaxis()->SetTitle("TIiiii");
> >   gPad->Modified(); 
> > 
> >
> >
> >I wanted to put an X label as well as Y Label.
> >
> >I tried, TAxis * axis = (TAxis *)mg->GetXaxis();
> >         axis->SetTitle("XTITLE"); 
> >   
> >But illegal pointer message again.
> >
> >How ever, I can make this with TGraph.
> >Why? Isnt it true that TMultigraph is just related to TGraph?
> >Could this be a bug?
> >
> >
> >Thanks
> >
> >I used ROOT 3.05/05 gcc 3.3.3 Redhat 9.0
> >
> >  
> >
> 
> 

-- 

--------------------------------------------------------
                   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:14 MET