Re: TH->Draw() Draw options question.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Mar 17 1999 - 18:40:30 MET


Anton,
TObject::SetDrawOption will only be effective on an object already in
the pad.
The specified option is not stored with the object itself, but in the
option
attribute when the object is added in the pad list.
You must have the sequence
  hist->Draw("some or no option)
  hist->SetDrawOption(another option)


Rene Brun


Anton Fokin wrote:
> 
> Hi Rene,
> 
> if I write
> 
> hist->SetDrawOption("COLZ");
> hist->Draw();
> 
> it still draws with "" option. Moreover if I write
> 
> hist->SetDrawOption("COLZ");
> printf("Draw option - %s\n", hist->GetDrawOption());
> 
> it doesn't print any "COLZ" at all, but just "". Could you explain how it
> works or should work in reality?
> 
> Regards,
> 
> Dr. Anton Fokin
> 
> Division of Cosmic and Subatomic Physics
> Lund University
> Sweden
> 
> ----------
> > From: Rene Brun <Rene.Brun@cern.ch>
> > To: Anton Fokin <kosu_fokin@garbo.lucas.lu.se>
> > Cc: roottalk@hpsalo.cern.ch
> > Subject: Re: TH->Draw() Draw options question.
> > Date:  den 17 March 1999 16:30
> >
> > Anton Fokin wrote:
> > >
> > > Hi there,
> > >
> > > I couldn't find if it's possible to set draw options for a histo
> somewhere
> > > outside TH.Draw()? I would like to have different options set for every
> > > histo I have and let a histo draw itself with a corresponding draw
> option
> > > whenever I use a generall call to TH.Draw();
> > >
> > > Regards,
> > >
> > > Dr. Anton Fokin
> > >
> > > Division of Cosmic and Subatomic Physics
> > > Lund University
> > > Sweden
> >
> > Hi Anton,
> > Yes, this is possible. Via TObject::SetDrawOption(const char* option)
> > You can do:
> >   hist->Draw(some option);
> >   hist->SetDrawOption(another option) as many times as you want.
> > SetDrawOption is called by the histogram DrawPanel widget.
> >
> > Rene Brun



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